minor #33349 [Form] fix parameter type declaration and make fabbot happy (xabbuh)
This PR was merged into the 3.4 branch.
Discussion
----------
[Form] fix parameter type declaration and make fabbot happy
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
19b292893a
fix parameter type declaration and make fabbot happy
This commit is contained in:
commit
c08b42aacb
@ -31,7 +31,7 @@ interface FormInterface extends \ArrayAccess, \Traversable, \Countable
|
|||||||
* @throws Exception\LogicException when trying to set a parent for a form with
|
* @throws Exception\LogicException when trying to set a parent for a form with
|
||||||
* an empty name
|
* an empty name
|
||||||
*/
|
*/
|
||||||
public function setParent(FormInterface $parent = null);
|
public function setParent(self $parent = null);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the parent form.
|
* Returns the parent form.
|
||||||
|
@ -13,8 +13,9 @@ namespace Symfony\Component\Form\Tests;
|
|||||||
|
|
||||||
use PHPUnit\Framework\MockObject\MockObject;
|
use PHPUnit\Framework\MockObject\MockObject;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use Symfony\Component\EventDispatcher\EventDispatcher;
|
||||||
|
use Symfony\Component\Form\FormBuilder;
|
||||||
use Symfony\Component\Form\FormFactory;
|
use Symfony\Component\Form\FormFactory;
|
||||||
use Symfony\Component\Form\FormInterface;
|
|
||||||
use Symfony\Component\Form\FormTypeGuesserChain;
|
use Symfony\Component\Form\FormTypeGuesserChain;
|
||||||
use Symfony\Component\Form\Guess\Guess;
|
use Symfony\Component\Form\Guess\Guess;
|
||||||
use Symfony\Component\Form\Guess\TypeGuess;
|
use Symfony\Component\Form\Guess\TypeGuess;
|
||||||
@ -194,7 +195,7 @@ class FormFactoryTest extends TestCase
|
|||||||
->method('buildForm')
|
->method('buildForm')
|
||||||
->with($this->builder, $resolvedOptions);
|
->with($this->builder, $resolvedOptions);
|
||||||
|
|
||||||
$form = $this->createMock(FormInterface::class);
|
$form = $this->createForm();
|
||||||
|
|
||||||
$this->builder->expects($this->once())
|
$this->builder->expects($this->once())
|
||||||
->method('getForm')
|
->method('getForm')
|
||||||
@ -227,7 +228,7 @@ class FormFactoryTest extends TestCase
|
|||||||
->method('buildForm')
|
->method('buildForm')
|
||||||
->with($this->builder, $resolvedOptions);
|
->with($this->builder, $resolvedOptions);
|
||||||
|
|
||||||
$form = $this->createMock(FormInterface::class);
|
$form = $this->createForm();
|
||||||
|
|
||||||
$this->builder->expects($this->once())
|
$this->builder->expects($this->once())
|
||||||
->method('getForm')
|
->method('getForm')
|
||||||
@ -467,6 +468,13 @@ class FormFactoryTest extends TestCase
|
|||||||
$this->assertSame($this->builder, $this->builder);
|
$this->assertSame($this->builder, $this->builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function createForm()
|
||||||
|
{
|
||||||
|
$formBuilder = new FormBuilder('', null, new EventDispatcher(), $this->factory);
|
||||||
|
|
||||||
|
return $formBuilder->getForm();
|
||||||
|
}
|
||||||
|
|
||||||
private function getMockFactory(array $methods = [])
|
private function getMockFactory(array $methods = [])
|
||||||
{
|
{
|
||||||
return $this->getMockBuilder('Symfony\Component\Form\FormFactory')
|
return $this->getMockBuilder('Symfony\Component\Form\FormFactory')
|
||||||
|
Reference in New Issue
Block a user