Skip to content

Commit d861b33

Browse files
Skip tests that fatal-error on PHP 7.4 because of missing parent classes
1 parent 4af1fd6 commit d861b33

File tree

6 files changed

+50
-0
lines changed

6 files changed

+50
-0
lines changed

src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/ValidatorCacheWarmerTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\Tests\CacheWarmer;
1313

14+
use PHPUnit\Framework\Warning;
1415
use Symfony\Bundle\FrameworkBundle\CacheWarmer\ValidatorCacheWarmer;
1516
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
1617
use Symfony\Component\Cache\Adapter\ArrayAdapter;
@@ -23,6 +24,10 @@ class ValidatorCacheWarmerTest extends TestCase
2324
{
2425
public function testWarmUp()
2526
{
27+
if (\PHP_VERSION_ID >= 70400) {
28+
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
29+
}
30+
2631
$validatorBuilder = new ValidatorBuilder();
2732
$validatorBuilder->addXmlMapping(__DIR__.'/../Fixtures/Validation/Resources/person.xml');
2833
$validatorBuilder->addYamlMapping(__DIR__.'/../Fixtures/Validation/Resources/author.yml');

src/Symfony/Component/Config/Tests/Resource/ClassExistenceResourceTest.php

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

1414
use PHPUnit\Framework\TestCase;
15+
use PHPUnit\Framework\Warning;
1516
use Symfony\Component\Config\Resource\ClassExistenceResource;
1617
use Symfony\Component\Config\Tests\Fixtures\BadParent;
1718
use Symfony\Component\Config\Tests\Fixtures\Resource\ConditionalClass;
@@ -77,6 +78,10 @@ public function testExistsKo()
7778

7879
public function testBadParentWithTimestamp()
7980
{
81+
if (\PHP_VERSION_ID >= 70400) {
82+
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
83+
}
84+
8085
$res = new ClassExistenceResource(BadParent::class, false);
8186
$this->assertTrue($res->isFresh(time()));
8287
}
@@ -87,6 +92,10 @@ public function testBadParentWithTimestamp()
8792
*/
8893
public function testBadParentWithNoTimestamp()
8994
{
95+
if (\PHP_VERSION_ID >= 70400) {
96+
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
97+
}
98+
9099
$res = new ClassExistenceResource(BadParent::class, false);
91100
$res->isFresh(0);
92101
}

src/Symfony/Component/DependencyInjection/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

src/Symfony/Component/DependencyInjection/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);

src/Symfony/Component/DependencyInjection/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();

src/Symfony/Component/DependencyInjection/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)