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:
Alexander M. Turek 2021-07-15 16:09:11 +02:00
commit a4992b01e8
1 changed files with 5 additions and 1 deletions

View File

@ -503,7 +503,11 @@ abstract class ControllerTraitTest extends TestCase
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->expects($this->once())->method('create')->willReturn($form);