Skip to content

KernelTestCase no longer works with PhpUnit 6.0+ #21534

Closed
@advancingu

Description

@advancingu
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.2.2

Preconditions:

  • Have a blank Symfony project version 3.2.x as installed by Symfony project generator.
  • Install PhpUnit 6.0.x with composer using composer require --dev phpunit/phpunit=~6.0.

Steps to reproduce:

  1. Run PhpUnit 6 with vendor/bin/phpunit -c .

Actual result:

PHP Fatal error:  Class 'PHPUnit_Framework_TestCase' not found in /home/user/project/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php on line 23

Expected result:

PHPUnit 6.0.3 by Sebastian Bergmann and contributors.

.                                                                   1 / 1 (100%)

Time: 107 ms, Memory: 12.00MB

OK (1 test, 2 assertions)

Notes:

  • It appears the old class name PHPUnit_Framework_TestCase which is used as a parent class of vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php was completely dropped in favor of PSR compatible namespacing in PhpUnit 6 (see this commit).
  • The new namespaced class name was introduced in PhpUnit 4.8 5.4 (see changelog).
  • Would it be possible to replace the parent class of KernelTestCase with the new namespaced class?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions