merged branch jakzal/form-validator-tests-fix (PR #7996)
This PR was merged into the 2.2 branch. Discussion ---------- Fixed failing 2.2 tests | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | -1858b96b7d
introduced a mocked context and therefore `getExecutionContext()` is was renamed to `getMockExectionContext()`. Commits -------ef87ba7
[Form] Fixed a method name.
This commit is contained in:
commit
300130a773
|
@ -293,17 +293,16 @@ class FormValidatorTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
public function testDontExecuteFunctionNames()
|
||||
{
|
||||
$context = $this->getExecutionContext();
|
||||
$graphWalker = $context->getGraphWalker();
|
||||
$context = $this->getMockExecutionContext();
|
||||
$object = $this->getMock('\stdClass');
|
||||
$options = array('validation_groups' => 'header');
|
||||
$form = $this->getBuilder('name', '\stdClass', $options)
|
||||
->setData($object)
|
||||
->getForm();
|
||||
|
||||
$graphWalker->expects($this->once())
|
||||
->method('walkReference')
|
||||
->with($object, 'header', 'data', true);
|
||||
$context->expects($this->once())
|
||||
->method('validate')
|
||||
->with($object, 'data', 'header', true);
|
||||
|
||||
$this->validator->initialize($context);
|
||||
$this->validator->validate($form, new Form());
|
||||
|
|
Reference in New Issue