8000 minor #29914 ensure compatibility with older PHPUnit mocks (xabbuh) · symfony/symfony@e231edd · GitHub
[go: up one dir, main page]

Skip to content

Commit e231edd

Browse files
committed
minor #29914 ensure compatibility with older PHPUnit mocks (xabbuh)
This PR was merged into the 3.4 branch. Discussion ---------- ensure compatibility with older PHPUnit mocks | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | alternative to #29913 | License | MIT | Doc PR | Commits ------- b714419 ensure compatibility with older PHPUnit mocks
2 parents b6b5976 + b714419 commit e231edd

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTraitTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Bundle\FrameworkBundle\Controller\ControllerTrait;
1515
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
1616
use Symfony\Component\DependencyInjection\Container;
17+
use Symfony\Component\Form\Form;
1718
use Symfony\Component\HttpFoundation\BinaryFileResponse;
1819
use Symfony\Component\HttpFoundation\File\File;
1920
use Symfony\Component\HttpFoundation\JsonResponse;
@@ -486,7 +487,8 @@ public function testCreateNotFoundException()
486487

487488
public function testCreateForm()
488489
{
489-
$form = $this->getMockBuilder('Symfony\Component\Form\FormInterface')->getMock();
490+
$config = $this->getMockBuilder('Symfony\Component\Form\FormConfigInterface')->getMock();
491+
$form = new Form($config);
490492

491493
$formFactory = $this->getMockBuilder('Symfony\Component\Form\FormFactoryInterface')->getMock();
492494
$formFactory->expects($this->once())->method('create')->willReturn($form);

src/Symfony/Component/HttpKernel/Tests/EventListener/ProfilerListenerTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Symfony\Component\HttpKernel\EventListener\ProfilerListener;
2020
use Symfony\Component\HttpKernel\Exception\HttpException;
2121
use Symfony\Component\HttpKernel\Kernel;
22+
use Symfony\Component\HttpKernel\Profiler\Profile;
2223

2324
class ProfilerListenerTest extends TestCase
2425
{
@@ -27,9 +28,7 @@ class ProfilerListenerTest extends TestCase
2728
*/
2829
public function testKernelTerminate()
2930
{
30-
$profile = $this->getMockBuilder('Symfony\Component\HttpKernel\Profiler\Profile')
31-
->disableOriginalConstructor()
32-
->getMock();
31+
$profile = new Profile('token');
3332

3433
$profiler = $this->getMockBuilder('Symfony\Component\HttpKernel\Profiler\Profiler')
3534
->disableOriginalConstructor()

0 commit comments

Comments
 (0)
0