Skip to content

Commit 6315e5f

Browse files
Merge branch '3.4' into 4.3
* 3.4: [Yaml] fix test for PHP 7.4 Add polyfill for TestCase::createMock() Skip tests that fatal-error on PHP 7.4 because of missing parent classes
2 parents 519cbd1 + b3c614b commit 6315e5f

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 Psr\Log\LoggerInterface;
1617
use Psr\Log\NullLogger;
1718
use Symfony\Component\Config\FileLocator;
@@ -353,6 +354,10 @@ public function testClassNotFoundThrowsException()
353354
*/
354355
public function testParentClassNotFoundThrowsException()
355356
{
357+
if (\PHP_VERSION_ID >= 70400) {
358+
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
359+
}
360+
356361
$container = new ContainerBuilder();
357362

358363
$aDefinition = $container->register('a', __NAMESPACE__.'\BadParentTypeHintedArgument');
@@ -618,6 +623,10 @@ public function getCreateResourceTests()
618623

619624
public function testIgnoreServiceWithClassNotExisting()
620625
{
626+
if (\PHP_VERSION_ID >= 70400) {
627+
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
628+
}
629+
621630
$container = new ContainerBuilder();
622631

623632
$container->register('class_not_exist', __NAMESPACE__.'\OptionalServiceClass');
@@ -823,6 +832,10 @@ public function testExceptionWhenAliasExists()
823832
*/
824833
public function testExceptionWhenAliasDoesNotExist()
825834
{
835+
if (\PHP_VERSION_ID >= 70400) {
836+
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
837+
}
838+
826839
$container = new ContainerBuilder();
827840

828841
// 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;
@@ -1060,6 +1061,10 @@ public function testInlineSelfRef()
10601061

10611062
public function testHotPathOptimizations()
10621063
{
1064+
if (\PHP_VERSION_ID >= 70400) {
1065+
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
1066+
}
1067+
10631068
$container = include self::$fixturesPath.'/containers/container_inline_requires.php';
10641069
$container->setParameter('inline_requires', true);
10651070
$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;
@@ -111,6 +112,10 @@ public function testRegisterClasses()
111112

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

160165
public function testNestedRegisterClasses()
161166
{
167+
if (\PHP_VERSION_ID >= 70400) {
168+
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
169+
}
170+
162171
$container = new ContainerBuilder();
163172
$loader = new TestFileLoader($container, new FileLocator(self::$fixturesPath.'/Fixtures'));
164173

@@ -187,6 +196,10 @@ public function testNestedRegisterClasses()
187196

188197
public function testMissingParentClass()
189198
{
199+
if (\PHP_VERSION_ID >= 70400) {
200+
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
201+
}
202+
190203
$container = new ContainerBuilder();
191204
$container->setParameter('bad_classes_dir', 'BadClasses');
192205
$loader = new TestFileLoader($container, new FileLocator(self::$fixturesPath.'/Fixtures'));

0 commit comments

Comments
 (0)