Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip tests that fatal-error on PHP 7.4 because of missing parent classes #32864

Merged
merged 1 commit into from
Aug 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Bundle\FrameworkBundle\Tests\CacheWarmer;

use PHPUnit\Framework\Warning;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Bundle\FrameworkBundle\CacheWarmer\ValidatorCacheWarmer;
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
Expand All @@ -26,6 +27,10 @@ class ValidatorCacheWarmerTest extends TestCase

public function testWarmUp()
{
if (\PHP_VERSION_ID >= 70400) {
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
}

$validatorBuilder = new ValidatorBuilder();
$validatorBuilder->addXmlMapping(__DIR__.'/../Fixtures/Validation/Resources/person.xml');
$validatorBuilder->addYamlMapping(__DIR__.'/../Fixtures/Validation/Resources/author.yml');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Symfony\Component\Config\Tests\Resource;

use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\Warning;
use Symfony\Component\Config\Resource\ClassExistenceResource;
use Symfony\Component\Config\Tests\Fixtures\BadParent;
use Symfony\Component\Config\Tests\Fixtures\Resource\ConditionalClass;
Expand Down Expand Up @@ -77,6 +78,10 @@ public function testExistsKo()

public function testBadParentWithTimestamp()
{
if (\PHP_VERSION_ID >= 70400) {
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
}

$res = new ClassExistenceResource(BadParent::class, false);
$this->assertTrue($res->isFresh(time()));
}
Expand All @@ -87,6 +92,10 @@ public function testBadParentWithTimestamp()
*/
public function testBadParentWithNoTimestamp()
{
if (\PHP_VERSION_ID >= 70400) {
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
}

$res = new ClassExistenceResource(BadParent::class, false);
$res->isFresh(0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Symfony\Component\DependencyInjection\Tests\Compiler;

use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\Warning;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\Compiler\AutowirePass;
use Symfony\Component\DependencyInjection\Compiler\AutowireRequiredMethodsPass;
Expand Down Expand Up @@ -395,6 +396,10 @@ public function testClassNotFoundThrowsException()
*/
public function testParentClassNotFoundThrowsException()
{
if (\PHP_VERSION_ID >= 70400) {
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
}

$container = new ContainerBuilder();

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

public function testIgnoreServiceWithClassNotExisting()
{
if (\PHP_VERSION_ID >= 70400) {
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
}

$container = new ContainerBuilder();

$container->register('class_not_exist', __NAMESPACE__.'\OptionalServiceClass');
Expand Down Expand Up @@ -917,6 +926,10 @@ public function testExceptionWhenAliasExists()
*/
public function testExceptionWhenAliasDoesNotExist()
{
if (\PHP_VERSION_ID >= 70400) {
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
}

$container = new ContainerBuilder();

// multiple I instances... but no IInterface alias
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Symfony\Component\DependencyInjection\Tests\Compiler;

use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\Warning;
use Symfony\Component\DependencyInjection\Argument\BoundArgument;
use Symfony\Component\DependencyInjection\Compiler\AutowireRequiredMethodsPass;
use Symfony\Component\DependencyInjection\Compiler\ResolveBindingsPass;
Expand Down Expand Up @@ -69,6 +70,10 @@ public function testUnusedBinding()
*/
public function testMissingParent()
{
if (\PHP_VERSION_ID >= 70400) {
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
}

$container = new ContainerBuilder();

$definition = $container->register(ParentNotExists::class, ParentNotExists::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Symfony\Component\DependencyInjection\Tests\Dumper;

use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\Warning;
use Psr\Container\ContainerInterface;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\Config\FileLocator;
Expand Down Expand Up @@ -906,6 +907,10 @@ public function testInlineSelfRef()

public function testHotPathOptimizations()
{
if (\PHP_VERSION_ID >= 70400) {
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
}

$container = include self::$fixturesPath.'/containers/container_inline_requires.php';
$container->setParameter('inline_requires', true);
$container->compile();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Symfony\Component\DependencyInjection\Tests\Loader;

use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\Warning;
use Psr\Container\ContainerInterface as PsrContainerInterface;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\Config\FileLocator;
Expand Down Expand Up @@ -112,6 +113,10 @@ public function testRegisterClasses()

public function testRegisterClassesWithExclude()
{
if (\PHP_VERSION_ID >= 70400) {
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
}

$container = new ContainerBuilder();
$container->setParameter('other_dir', 'OtherDir');
$loader = new TestFileLoader($container, new FileLocator(self::$fixturesPath.'/Fixtures'));
Expand Down Expand Up @@ -141,6 +146,10 @@ public function testRegisterClassesWithExclude()

public function testNestedRegisterClasses()
{
if (\PHP_VERSION_ID >= 70400) {
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
}

$container = new ContainerBuilder();
$loader = new TestFileLoader($container, new FileLocator(self::$fixturesPath.'/Fixtures'));

Expand Down Expand Up @@ -169,6 +178,10 @@ public function testNestedRegisterClasses()

public function testMissingParentClass()
{
if (\PHP_VERSION_ID >= 70400) {
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
}

$container = new ContainerBuilder();
$container->setParameter('bad_classes_dir', 'BadClasses');
$loader = new TestFileLoader($container, new FileLocator(self::$fixturesPath.'/Fixtures'));
Expand Down