Skip to content

Commit b5e09ee

Browse files
committed
minor symfony#13172 [Form] Remove a redundant test (jakzal)
This PR was merged into the 2.3 branch. Discussion ---------- [Form] Remove a redundant test | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - As a result of changing `bind()` to `submit()` in symfony#13161, the `testValidateTokenOnBindIfRootAndCompoundUsesTypeClassAsIntentionIfEmptyFormName()` is exactly the same as `testValidateTokenOnSubmitIfRootAndCompoundUsesTypeClassAsIntentionIfEmptyFormName()`. This makes the form tests to fail on 2.5 branch, as after a merge csrf provider is used instead of the token manager. Commits ------- ae10615 [Form] Remove a redundant test.
2 parents 844741a + ae10615 commit b5e09ee

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

Diff for: src/Symfony/Component/Form/Tests/Extension/Csrf/Type/FormTypeCsrfExtensionTest.php

-31
Original file line numberDiff line numberDiff line change
@@ -278,37 +278,6 @@ public function testValidateTokenOnSubmitIfRootAndCompoundUsesTypeClassAsIntenti
278278
$this->assertSame($valid, $form->isValid());
279279
}
280280

281-
/**
282-
* @dataProvider provideBoolean
283-
*/
284-
public function testValidateTokenOnBindIfRootAndCompoundUsesTypeClassAsIntentionIfEmptyFormName($valid)
285-
{
286-
$this->csrfProvider->expects($this->once())
287-
->method('isCsrfTokenValid')
288-
->with('Symfony\Component\Form\Extension\Core\Type\FormType', 'token')
289-
->will($this->returnValue($valid));
290-
291-
$form = $this->factory
292-
->createNamedBuilder('', 'form', null, array(
293-
'csrf_field_name' => 'csrf',
294-
'csrf_provider' => $this->csrfProvider,
295-
'compound' => true,
296-
))
297-
->add('child', 'text')
298-
->getForm();
299-
300-
$form->submit(array(
301-
'child' => 'foobar',
302-
'csrf' => 'token',
303-
));
304-
305-
// Remove token from data
306-
$this->assertSame(array('child' => 'foobar'), $form->getData());
307-
308-
// Validate accordingly
309-
$this->assertSame($valid, $form->isValid());
310-
}
311-
312281
public function testFailIfRootAndCompoundAndTokenMissing()
313282
{
314283
$this->csrfProvider->expects($this->never())

0 commit comments

Comments
 (0)