wxt-8.x-3.011/tests/src/Unit/FormHelperTest.php
tests/src/Unit/FormHelperTest.php
<?php
namespace Drupal\Tests\wxt\Unit;
use Prophecy\PhpUnit\ProphecyTrait;
use Drupal\Core\Render\ElementInfoManagerInterface;
use Drupal\wxt\FormHelper;
use Drupal\Tests\UnitTestCase;
/**
* @group wxt
*
* @coversDefaultClass \Drupal\wxt\FormHelper
*/
class FormHelperTest extends UnitTestCase {
use ProphecyTrait;
/**
* Leveraged from code provided by Acquia for the Lightning distribution.
*
* @covers ::applyStandardProcessing
*/
public function testApplyStandardProcessing() {
$element_info = $this->prophesize(ElementInfoManagerInterface::class);
$element_info->getInfo('location')->willReturn([
'#process' => [
'process_location',
],
]);
$element = ['#type' => 'location'];
$form_helper = new FormHelper($this->root, $element_info->reveal());
$form_helper->applyStandardProcessing($element);
$this->assertEquals(['process_location'], $element['#process']);
}
}
