Skip to content

Commit b3c614b

Browse files
Skip tests that fatal-error on PHP 7.4 because of missing parent classes
1 parent 87e0acc commit b3c614b

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

Tests/Compiler/AutowirePassTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\DependencyInjection\Tests\Compiler;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use PHPUnit\Framework\Warning;
1516
use Symfony\Component\Config\FileLocator;
1617
use Symfony\Component\DependencyInjection\Compiler\AutowirePass;
1718
use Symfony\Component\DependencyInjection\Compiler\AutowireRequiredMethodsPass;
@@ -395,6 +396,10 @@ public function testClassNotFoundThrowsException()
395396
*/
396397
public function testParentClassNotFoundThrowsException()
397398
{
399+
if (\PHP_VERSION_ID >= 70400) {
400+
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
401+
}
402+
398403
$container = new ContainerBuilder();
399404

400405
$aDefinition = $container->register('a', __NAMESPACE__.'\BadParentTypeHintedArgument');
@@ -707,6 +712,10 @@ public function getCreateResourceTests()
707712

708713
public function testIgnoreServiceWithClassNotExisting()
709714
{
715+
if (\PHP_VERSION_ID >= 70400) {
716+
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
717+
}
718+
710719
$container = new ContainerBuilder();
711720

712721
$container->register('class_not_exist', __NAMESPACE__.'\OptionalServiceClass');
@@ -917,6 +926,10 @@ public function testExceptionWhenAliasExists()
917926
*/
918927
public function testExceptionWhenAliasDoesNotExist()
919928
{
929+
if (\PHP_VERSION_ID >= 70400) {
930+
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
931+
}
932+
920933
$container = new ContainerBuilder();
921934

922935
// multiple I instances... but no IInterface alias

Tests/Compiler/ResolveBindingsPassTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\DependencyInjection\Tests\Compiler;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use PHPUnit\Framework\Warning;
1516
use Symfony\Component\DependencyInjection\Argument\BoundArgument;
1617
use Symfony\Component\DependencyInjection\Compiler\AutowireRequiredMethodsPass;
1718
use Symfony\Component\DependencyInjection\Compiler\ResolveBindingsPass;
@@ -69,6 +70,10 @@ public function testUnusedBinding()
6970
*/
7071
public function testMissingParent()
7172
{
73+
if (\PHP_VERSION_ID >= 70400) {
74+
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
75+
}
76+
7277
$container = new ContainerBuilder();
7378

7479
$definition = $container->register(ParentNotExists::class, ParentNotExists::class);

Tests/Dumper/PhpDumperTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\DependencyInjection\Tests\Dumper;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use PHPUnit\Framework\Warning;
1516
use Psr\Container\ContainerInterface;
1617
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1718
use Symfony\Component\Config\FileLocator;
@@ -906,6 +907,10 @@ public function testInlineSelfRef()
906907

907908
public function testHotPathOptimizations()
908909
{
910+
if (\PHP_VERSION_ID >= 70400) {
911+
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
912+
}
913+
909914
$container = include self::$fixturesPath.'/containers/container_inline_requires.php';
910915
$container->setParameter('inline_requires', true);
911916
$container->compile();

Tests/Loader/FileLoaderTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\DependencyInjection\Tests\Loader;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use PHPUnit\Framework\Warning;
1516
use Psr\Container\ContainerInterface as PsrContainerInterface;
1617
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1718
use Symfony\Component\Config\FileLocator;
@@ -112,6 +113,10 @@ public function testRegisterClasses()
112113

113114
public function testRegisterClassesWithExclude()
114115
{
116+
if (\PHP_VERSION_ID >= 70400) {
117+
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
118+
}
119+
115120
$container = new ContainerBuilder();
116121
$container->setParameter('other_dir', 'OtherDir');
117122
$loader = new TestFileLoader($container, new FileLocator(self::$fixturesPath.'/Fixtures'));
@@ -141,6 +146,10 @@ public function testRegisterClassesWithExclude()
141146

142147
public function testNestedRegisterClasses()
143148
{
149+
if (\PHP_VERSION_ID >= 70400) {
150+
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
151+
}
152+
144153
$container = new ContainerBuilder();
145154
$loader = new TestFileLoader($container, new FileLocator(self::$fixturesPath.'/Fixtures'));
146155

@@ -169,6 +178,10 @@ public function testNestedRegisterClasses()
169178

170179
public function testMissingParentClass()
171180
{
181+
if (\PHP_VERSION_ID >= 70400) {
182+
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
183+
}
184+
172185
$container = new ContainerBuilder();
173186
$container->setParameter('bad_classes_dir', 'BadClasses');
174187
$loader = new TestFileLoader($container, new FileLocator(self::$fixturesPath.'/Fixtures'));

0 commit comments

Comments
 (0)