Skip to content

Commit ea687c0

Browse files
author
Massimiliano Braglia
committed
Fix build after up deps
1 parent c26aa16 commit ea687c0

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

tests/Form/Extension/AutoSubmitRequestHandlerTest.php

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use Fazland\ApiPlatformBundle\Form\Extension\AutoSubmitRequestHandler;
66
use Symfony\Component\Form\RequestHandlerInterface;
77
use Symfony\Component\Form\Tests\Extension\HttpFoundation\HttpFoundationRequestHandlerTest;
8-
use Symfony\Component\HttpFoundation\Request;
98

109
class AutoSubmitRequestHandlerTest extends HttpFoundationRequestHandlerTest
1110
{
@@ -22,22 +21,24 @@ protected function getRequestHandler(): RequestHandlerInterface
2221
*/
2322
public function testDoNotSubmitFormWithEmptyNameIfNoFieldInRequest($method): void
2423
{
25-
$form = $this->getMockForm('', $method);
26-
$form->expects(self::any())
27-
->method('all')
28-
->will(self::returnValue([
29-
'param1' => $this->getMockForm('param1'),
30-
'param2' => $this->getMockForm('param2'),
31-
]))
32-
;
33-
34-
$this->setRequestData($method, ['paramx' => 'submitted value']);
35-
36-
$form->expects(self::once())
37-
->method('submit')
38-
->with(['paramx' => 'submitted value'], Request::METHOD_PATCH !== $method)
39-
;
24+
self::markTestSkipped('Not applicable to this request handler');
25+
}
26+
27+
/**
28+
* @dataProvider methodProvider
29+
*/
30+
public function testDoSubmitFormWithEmptyNameIfNoFieldInRequest(string $method): void
31+
{
32+
$form = $this->createForm('', $method, true);
33+
$form->add($this->createForm('param1'));
34+
$form->add($this->createForm('param2'));
35+
36+
$this->setRequestData($method, [
37+
'paramx' => 'submitted value',
38+
]);
4039

4140
$this->requestHandler->handleRequest($form, $this->request);
41+
42+
$this->assertTrue($form->isSubmitted());
4243
}
4344
}

0 commit comments

Comments
 (0)