|
13 | 13 |
|
14 | 14 | use PHPUnit\Framework\MockObject\MockObject; |
15 | 15 | use PHPUnit\Framework\TestCase; |
| 16 | +use Symfony\Component\EventDispatcher\EventDispatcher; |
| 17 | +use Symfony\Component\Form\FormBuilder; |
16 | 18 | use Symfony\Component\Form\FormFactory; |
17 | | -use Symfony\Component\Form\FormInterface; |
18 | 19 | use Symfony\Component\Form\FormTypeGuesserChain; |
19 | 20 | use Symfony\Component\Form\Guess\Guess; |
20 | 21 | use Symfony\Component\Form\Guess\TypeGuess; |
@@ -194,7 +195,7 @@ public function testCreateUsesBlockPrefixIfTypeGivenAsString() |
194 | 195 | ->method('buildForm') |
195 | 196 | ->with($this->builder, $resolvedOptions); |
196 | 197 |
|
197 | | - $form = $this->createMock(FormInterface::class); |
| 198 | + $form = $this->createForm(); |
198 | 199 |
|
199 | 200 | $this->builder->expects($this->once()) |
200 | 201 | ->method('getForm') |
@@ -227,7 +228,7 @@ public function testCreateNamed() |
227 | 228 | ->method('buildForm') |
228 | 229 | ->with($this->builder, $resolvedOptions); |
229 | 230 |
|
230 | | - $form = $this->createMock(FormInterface::class); |
| 231 | + $form = $this->createForm(); |
231 | 232 |
|
232 | 233 | $this->builder->expects($this->once()) |
233 | 234 | ->method('getForm') |
@@ -467,6 +468,13 @@ public function testCreateBuilderUsesPatternIfFound() |
467 | 468 | $this->assertSame($this->builder, $this->builder); |
468 | 469 | } |
469 | 470 |
|
| 471 | + protected function createForm() |
| 472 | + { |
| 473 | + $formBuilder = new FormBuilder('', null, new EventDispatcher(), $this->factory); |
| 474 | + |
| 475 | + return $formBuilder->getForm(); |
| 476 | + } |
| 477 | + |
470 | 478 | private function getMockFactory(array $methods = []) |
471 | 479 | { |
472 | 480 | return $this->getMockBuilder('Symfony\Component\Form\FormFactory') |
|
0 commit comments