Skip to content

Commit eb645d0

Browse files
committed
Replace warning by isolated test
1 parent 02a90d2 commit eb645d0

File tree

6 files changed

+33
-40
lines changed

6 files changed

+33
-40
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@
2222

2323
class ValidatorCacheWarmerTest extends TestCase
2424
{
25+
/**
26+
* @runInSeparateProcess https://bugs.php.net/78351
27+
*/
2528
public function testWarmUp()
2629
{
27-
if (\PHP_VERSION_ID >= 70400) {
28-
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
29-
}
30-
3130
$validatorBuilder = new ValidatorBuilder();
3231
$validatorBuilder->addXmlMapping(__DIR__.'/../Fixtures/Validation/Resources/person.xml');
3332
$validatorBuilder->addYamlMapping(__DIR__.'/../Fixtures/Validation/Resources/author.yml');

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,23 +76,22 @@ public function testExistsKo()
7676
}
7777
}
7878

79+
/**
80+
* @runInSeparateProcess https://bugs.php.net/78351
81+
*/
7982
public function testBadParentWithTimestamp()
8083
{
81-
if (\PHP_VERSION_ID >= 70400) {
82-
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
83-
}
84-
8584
$res = new ClassExistenceResource(BadParent::class, false);
8685
$this->assertTrue($res->isFresh(time()));
8786
}
8887

88+
/**
89+
* @runInSeparateProcess https://bugs.php.net/78351
90+
*/
8991
public function testBadParentWithNoTimestamp()
9092
{
9193
$this->expectException('ReflectionException');
9294
$this->expectExceptionMessage('Class Symfony\Component\Config\Tests\Fixtures\MissingParent not found');
93-
if (\PHP_VERSION_ID >= 70400) {
94-
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
95-
}
9695

9796
$res = new ClassExistenceResource(BadParent::class, false);
9897
$res->isFresh(0);

src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -378,13 +378,13 @@ public function testClassNotFoundThrowsException()
378378
$pass->process($container);
379379
}
380380

381+
/**
382+
* @runInSeparateProcess https://bugs.php.net/78351
383+
*/
381384
public function testParentClassNotFoundThrowsException()
382385
{
383386
$this->expectException('Symfony\Component\DependencyInjection\Exception\AutowiringFailedException');
384387
$this->expectExceptionMessage('Cannot autowire service "a": argument "$r" of method "Symfony\Component\DependencyInjection\Tests\Compiler\BadParentTypeHintedArgument::__construct()" has type "Symfony\Component\DependencyInjection\Tests\Compiler\OptionalServiceClass" but this class is missing a parent class (Class Symfony\Bug\NotExistClass not found).');
385-
if (\PHP_VERSION_ID >= 70400) {
386-
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
387-
}
388388

389389
$container = new ContainerBuilder();
390390

@@ -692,12 +692,11 @@ public function getCreateResourceTests()
692692
];
693693
}
694694

695+
/**
696+
* @runInSeparateProcess https://bugs.php.net/78351
697+
*/
695698
public function testIgnoreServiceWithClassNotExisting()
696699
{
697-
if (\PHP_VERSION_ID >= 70400) {
698-
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
699-
}
700-
701700
$container = new ContainerBuilder();
702701

703702
$container->register('class_not_exist', __NAMESPACE__.'\OptionalServiceClass');
@@ -894,13 +893,13 @@ public function testExceptionWhenAliasExists()
894893
$pass->process($container);
895894
}
896895

896+
/**
897+
* @runInSeparateProcess https://bugs.php.net/78351
898+
*/
897899
public function testExceptionWhenAliasDoesNotExist()
898900
{
899901
$this->expectException('Symfony\Component\DependencyInjection\Exception\AutowiringFailedException');
900902
$this->expectExceptionMessage('Cannot autowire service "j": argument "$i" of method "Symfony\Component\DependencyInjection\Tests\Compiler\J::__construct()" references class "Symfony\Component\DependencyInjection\Tests\Compiler\I" but no such service exists. You should maybe alias this class to one of these existing services: "i", "i2".');
901-
if (\PHP_VERSION_ID >= 70400) {
902-
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
903-
}
904903

905904
$container = new ContainerBuilder();
906905

src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveBindingsPassTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ public function testUnusedBinding()
6262
$pass->process($container);
6363
}
6464

65+
/**
66+
* @runInSeparateProcess https://bugs.php.net/78351
67+
*/
6568
public function testMissingParent()
6669
{
6770
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
6871
$this->expectExceptionMessageRegExp('/Unused binding "\$quz" in service [\s\S]+/');
69-
if (\PHP_VERSION_ID >= 70400) {
70-
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
71-
}
7272

7373
$container = new ContainerBuilder();
7474

src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -894,12 +894,11 @@ public function testInlineSelfRef()
894894
$this->assertStringEqualsFile(self::$fixturesPath.'/php/services_inline_self_ref.php', $dumper->dump(['class' => 'Symfony_DI_PhpDumper_Test_Inline_Self_Ref']));
895895
}
896896

897+
/**
898+
* @runInSeparateProcess https://bugs.php.net/78351
899+
*/
897900
public function testHotPathOptimizations()
898901
{
899-
if (\PHP_VERSION_ID >= 70400) {
900-
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
901-
}
902-
903902
$container = include self::$fixturesPath.'/containers/container_inline_requires.php';
904903
$container->setParameter('inline_requires', true);
905904
$container->compile();

src/Symfony/Component/DependencyInjection/Tests/Loader/FileLoaderTest.php

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,11 @@ public function testRegisterClasses()
108108
);
109109
}
110110

111+
/**
112+
* @runInSeparateProcess https://bugs.php.net/78351
113+
*/
111114
public function testRegisterClassesWithExclude()
112115
{
113-
if (\PHP_VERSION_ID >= 70400) {
114-
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
115-
}
116-
117116
$container = new ContainerBuilder();
118117
$container->setParameter('other_dir', 'OtherDir');
119118
$loader = new TestFileLoader($container, new FileLocator(self::$fixturesPath.'/Fixtures'));
@@ -141,12 +140,11 @@ public function testRegisterClassesWithExclude()
141140
);
142141
}
143142

143+
/**
144+
* @runInSeparateProcess https://bugs.php.net/78351
145+
*/
144146
public function testNestedRegisterClasses()
145147
{
146-
if (\PHP_VERSION_ID >= 70400) {
147-
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
148-
}
149-
150148
$container = new ContainerBuilder();
151149
$loader = new TestFileLoader($container, new FileLocator(self::$fixturesPath.'/Fixtures'));
152150

@@ -173,12 +171,11 @@ public function testNestedRegisterClasses()
173171
$this->assertFalse($alias->isPrivate());
174172
}
175173

174+
/**
175+
* @runInSeparateProcess https://bugs.php.net/78351
176+
*/
176177
public function testMissingParentClass()
177178
{
178-
if (\PHP_VERSION_ID >= 70400) {
179-
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
180-
}
181-
182179
$container = new ContainerBuilder();
183180
$container->setParameter('bad_classes_dir', 'BadClasses');
184181
$loader = new TestFileLoader($container, new FileLocator(self::$fixturesPath.'/Fixtures'));

0 commit comments

Comments
 (0)