Skip to content

Commit

Permalink
Replace warning by isolated test
Browse files Browse the repository at this point in the history
  • Loading branch information
jderusse committed Aug 8, 2019
1 parent 02a90d2 commit eb645d0
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@

class ValidatorCacheWarmerTest extends TestCase
{
/**
* @runInSeparateProcess https://bugs.php.net/78351
*/
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 @@ -76,23 +76,22 @@ public function testExistsKo()
}
}

/**
* @runInSeparateProcess https://bugs.php.net/78351
*/
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()));
}

/**
* @runInSeparateProcess https://bugs.php.net/78351
*/
public function testBadParentWithNoTimestamp()
{
$this->expectException('ReflectionException');
$this->expectExceptionMessage('Class Symfony\Component\Config\Tests\Fixtures\MissingParent not found');
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 @@ -378,13 +378,13 @@ public function testClassNotFoundThrowsException()
$pass->process($container);
}

/**
* @runInSeparateProcess https://bugs.php.net/78351
*/
public function testParentClassNotFoundThrowsException()
{
$this->expectException('Symfony\Component\DependencyInjection\Exception\AutowiringFailedException');
$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).');
if (\PHP_VERSION_ID >= 70400) {
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
}

$container = new ContainerBuilder();

Expand Down Expand Up @@ -692,12 +692,11 @@ public function getCreateResourceTests()
];
}

/**
* @runInSeparateProcess https://bugs.php.net/78351
*/
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 @@ -894,13 +893,13 @@ public function testExceptionWhenAliasExists()
$pass->process($container);
}

/**
* @runInSeparateProcess https://bugs.php.net/78351
*/
public function testExceptionWhenAliasDoesNotExist()
{
$this->expectException('Symfony\Component\DependencyInjection\Exception\AutowiringFailedException');
$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".');
if (\PHP_VERSION_ID >= 70400) {
throw new Warning('PHP 7.4 breaks this test, see https://bugs.php.net/78351.');
}

$container = new ContainerBuilder();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ public function testUnusedBinding()
$pass->process($container);
}

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

$container = new ContainerBuilder();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -894,12 +894,11 @@ public function testInlineSelfRef()
$this->assertStringEqualsFile(self::$fixturesPath.'/php/services_inline_self_ref.php', $dumper->dump(['class' => 'Symfony_DI_PhpDumper_Test_Inline_Self_Ref']));
}

/**
* @runInSeparateProcess https://bugs.php.net/78351
*/
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 @@ -108,12 +108,11 @@ public function testRegisterClasses()
);
}

/**
* @runInSeparateProcess https://bugs.php.net/78351
*/
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,12 +140,11 @@ public function testRegisterClassesWithExclude()
);
}

/**
* @runInSeparateProcess https://bugs.php.net/78351
*/
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 All @@ -173,12 +171,11 @@ public function testNestedRegisterClasses()
$this->assertFalse($alias->isPrivate());
}

/**
* @runInSeparateProcess https://bugs.php.net/78351
*/
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

0 comments on commit eb645d0

Please sign in to comment.