minor #42132 [FrameworkBundle] Fix broken mock (derrabus)
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle] Fix broken mock
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | N/A
Backport from #42109. The mocked implementations of `getInheritData()` and `getName()` will currently return `null` which is something the real implementation would never do.
Commits
-------
6d2f428911
[FrameworkBundle] Fix broken mock
This commit is contained in:
commit
a4992b01e8
@ -503,7 +503,11 @@ abstract class ControllerTraitTest extends TestCase
|
|||||||
|
|
||||||
public function testCreateForm()
|
public function testCreateForm()
|
||||||
{
|
{
|
||||||
$form = new Form($this->createMock(FormConfigInterface::class));
|
$config = $this->createMock(FormConfigInterface::class);
|
||||||
|
$config->method('getInheritData')->willReturn(false);
|
||||||
|
$config->method('getName')->willReturn('');
|
||||||
|
|
||||||
|
$form = new Form($config);
|
||||||
|
|
||||||
$formFactory = $this->createMock(FormFactoryInterface::class);
|
$formFactory = $this->createMock(FormFactoryInterface::class);
|
||||||
$formFactory->expects($this->once())->method('create')->willReturn($form);
|
$formFactory->expects($this->once())->method('create')->willReturn($form);
|
||||||
|
Reference in New Issue
Block a user