diff --git a/UPGRADE-3.4.md b/UPGRADE-3.4.md index 21db4d1ed619..6858520efe16 100644 --- a/UPGRADE-3.4.md +++ b/UPGRADE-3.4.md @@ -13,6 +13,19 @@ Finder deprecated and will be removed in 4.0 as it used to fix a bug which existed before version 5.5.23/5.6.7. +FrameworkBundle +--------------- + + * Using the `KERNEL_DIR` environment variable or the automatic guessing based + on the `phpunit.xml` / `phpunit.xml.dist` file location is deprecated since 3.4. + Set the `KERNEL_CLASS` environment variable to the fully-qualified class name + of your Kernel instead. Not setting the `KERNEL_CLASS` environment variable + will throw an exception on 4.0 unless you override the `KernelTestCase::createKernel()` + or `KernelTestCase::getKernelClass()` method. + + * The `KernelTestCase::getPhpUnitXmlDir()` and `KernelTestCase::getPhpUnitCliConfigArgument()` + methods are deprecated since 3.4 and will be removed in 4.0. + Validator --------- diff --git a/UPGRADE-4.0.md b/UPGRADE-4.0.md index 9bf6e0bda02a..27cbc04fe0ac 100644 --- a/UPGRADE-4.0.md +++ b/UPGRADE-4.0.md @@ -330,6 +330,15 @@ FrameworkBundle * The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ValidateWorkflowsPass` class has been removed. Use the `Symfony\Component\Workflow\DependencyInjection\ValidateWorkflowsPass` class instead. + + * Using the `KERNEL_DIR` environment variable and the automatic guessing based + on the `phpunit.xml` file location have been removed from the `KernelTestCase::getKernelClass()` + method implementation. Set the `KERNEL_CLASS` environment variable to the + fully-qualified class name of your Kernel or override the `KernelTestCase::createKernel()` + or `KernelTestCase::getKernelClass()` method instead. + + * The methods `KernelTestCase::getPhpUnitXmlDir()` and `KernelTestCase::getPhpUnitCliConfigArgument()` + have been removed. * The `Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory` class has been removed. Use `Symfony\Component\Validator\ContainerConstraintValidatorFactory` instead. diff --git a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md index f1a45f0d6aad..f5aa2c8f04f9 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md @@ -1,6 +1,12 @@ CHANGELOG ========= +3.4.0 +----- + +* Deprecated using the `KERNEL_DIR` environment variable with `KernelTestCase::getKernelClass()`. +* Deprecated the `KernelTestCase::getPhpUnitXmlDir()` and `KernelTestCase::getPhpUnitCliConfigArgument()` methods. + 3.3.0 ----- diff --git a/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php b/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php index 26781cdf2285..802259eedbfe 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php +++ b/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php @@ -39,9 +39,13 @@ abstract class KernelTestCase extends TestCase * @return string The directory where phpunit.xml(.dist) is stored * * @throws \RuntimeException + * + * @deprecated since 3.4 and will be removed in 4.0. */ protected static function getPhpUnitXmlDir() { + @trigger_error(sprintf('The %s() method is deprecated since 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED); + if (!isset($_SERVER['argv']) || false === strpos($_SERVER['argv'][0], 'phpunit')) { throw new \RuntimeException('You must override the KernelTestCase::createKernel() method.'); } @@ -72,9 +76,13 @@ protected static function getPhpUnitXmlDir() * the last configuration argument. * * @return string The value of the PHPUnit CLI configuration option + * + * @deprecated since 3.4 and will be removed in 4.0. */ private static function getPhpUnitCliConfigArgument() { + @trigger_error(sprintf('The %s() method is deprecated since 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED); + $dir = null; $reversedArgs = array_reverse($_SERVER['argv']); foreach ($reversedArgs as $argIndex => $testArg) { @@ -112,6 +120,8 @@ protected static function getKernelClass() } return $class; + } else { + @trigger_error(sprintf('Using the KERNEL_DIR environment variable or the automatic guessing based on the phpunit.xml / phpunit.xml.dist file location is deprecated since 3.4. Set the KERNEL_CLASS environment variable to the fully-qualified class name of your Kernel instead. Not setting the KERNEL_CLASS environment variable will throw an exception on 4.0 unless you override the %1$::createKernel() or %1$::getKernelClass() method.', static::class), E_USER_DEPRECATED); } if (isset($_SERVER['KERNEL_DIR'])) {