8000 Re-enable previously failing PHP 7.4 test cases by nicolas-grekas · Pull Request #33567 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Re-enable previously failing PHP 7.4 test cases #33567

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

Merged
merged 1 commit into from
Sep 19, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ matrix:
env: deps=high
- php: 7.4snapshot
env: deps=low
- php: 7.4snapshot
env: deps=
allow_failures:
- php: 7.4snapshot
env: deps=
fast_finish: true

cache:
Expand Down Expand Up @@ -76,12 +71,6 @@ before_install:
export COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n' | sort)
find ~/.phpenv -name xdebug.ini -delete

if [[ $TRAVIS_PHP_VERSION = 7.4* && $deps ]]; then
export PHPUNIT_X="$PHPUNIT_X,issue-32995"
elif [[ $TRAVIS_PHP_VERSION = 7.4* ]]; then
export PHPUNIT_X="$PHPUNIT --group issue-32995"
fi

if [[ $TRAVIS_PHP_VERSION = 5.* || $TRAVIS_PHP_VERSION = hhvm* ]]; then
composer () {
$HOME/.phpenv/versions/7.1/bin/php $HOME/.phpenv/versions/7.1/bin/composer config platform.php $(echo ' <?php echo preg_replace("/-.*/", "", PHP_VERSION);' | php /dev/stdin)
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public static function register($mode = 0)
'remaining vendor' => array(),
);
$deprecationHandler = function ($type, $msg, $file, $line, $context = array()) use (&$deprecations, $getMode, $UtilPrefix, $inVendors) {
if ((E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type) || DeprecationErrorHandler::MODE_DISABLED === $mode = $getMode()) {
if ((E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type && (E_WARNING !== $type || false === strpos($msg, '" targeting switch is equivalent to "break'))) || DeprecationErrorHandler::MODE_DISABLED === $mode = $getMode()) {
return \call_user_func(DeprecationErrorHandler::getPhpUnitErrorHandler(), $type, $msg, $file, $line, $context);
}

Expand Down Expand Up @@ -285,7 +285,7 @@ public static function collectDeprecations($outputFile)
{
$deprecations = array();
$previousErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = array()) use (&$deprecations, &$previousErrorHandler) {
if (E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type) {
if (E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type && (E_WARNING !== $type || false === strpos($msg, '" targeting switch is equivalent to "break'))) {
if ($previousErrorHandler) {
return $previousErrorHandler($type, $msg, $file, $line, $context);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@

class ValidatorCacheWarmerTest extends TestCase
{
/**
* @group issue-32995
*
* @runInSeparateProcess https://github.com/symfony/symfony/issues/32995
*/
public function testWarmUp()
{
$validatorBuilder = new ValidatorBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,29 +72,12 @@ public function testGetHelp()
{
$command = new YamlLintCommand();
$expected = <<<EOF
The <info>%command.name%</info> command lints a YAML file and outputs to STDOUT
the first encountered syntax error.

You can validates YAML contents passed from STDIN:

<info>cat filename | php %command.full_name%</info>

You can also validate the syntax of a file:

<info>php %command.full_name% filename</info>

Or of a whole directory:

<info>php %command.full_name% dirname</info>
<info>php %command.full_name% dirname --format=json</info>

Or find all files in a bundle:

<info>php %command.full_name% @AcmeDemoBundle</info>

EOF;

$this->assertEquals($expected, $command->getHelp());
$this->assertStringContainsString($expected, $command->getHelp());
}

public function testLintFilesFromBundleDirectory()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,12 @@ public function testExistsKo()
}
}

/**
* @group issue-32995
*
* @runInSeparateProcess https://github.com/symfony/symfony/issues/32995
*/
public function testBadParentWithTimestamp()
{
$res = new ClassExistenceResource(BadParent::class, false);
$this->assertTrue($res->isFresh(time()));
}

/**
* @group issue-32995
*
* @runInSeparateProcess https://github.com/symfony/symfony/issues/32995
*/
public function testBadParentWithNoTimestamp()
{
$this->expectException('ReflectionException');
Expand Down
3 changes: 1 addition & 2 deletions src/Symfony/Component/Debug/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,7 @@ private function reRegister($prev)
*/
public function handleError($type, $message, $file, $line)
{
// @deprecated to be removed in Symfony 5.0
if (\PHP_VERSION_ID >= 70300 && $message && '"' === $message[0] && 0 === strpos($message, '"continue') && preg_match('/^"continue(?: \d++)?" targeting switch is equivalent to "break(?: \d++)?"\. Did you mean to use "continue(?: \d++)?"\?$/', $message)) {
if (\PHP_VERSION_ID >= 70300 && E_WARNING === $type && '"' === $message[0] && false !== strpos($message, '" targeting switch is equivalent to "break')) {
$type = E_DEPRECATED;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,6 @@ public function testClassNotFoundThrowsException()
$pass->process($container);
}

/**
* @group issue-32995
*
* @runInSeparateProcess https://github.com/symfony/symfony/issues/32995
*/
public function testParentClassNotFoundThrowsException()
{
$this->expectException('Symfony\Component\DependencyInjection\Exception\AutowiringFailedException');
Expand Down Expand Up @@ -693,11 +688,6 @@ public function getCreateResourceTests()
];
}

/**
* @group issue-32995
*
* @runInSeparateProcess https://github.com/symfony/symfony/issues/32995
*/
public function testIgnoreServiceWithClassNotExisting()
{
$container = new ContainerBuilder();
Expand Down Expand Up @@ -896,11 +886,6 @@ public function testExceptionWhenAliasExists()
$pass->process($container);
}

/**
* @group issue-32995
*
* @runInSeparateProcess https://github.com/symfony/symfony/issues/32995
*/
public function testExceptionWhenAliasDoesNotExist()
{
$this->expectException('Symfony\Component\DependencyInjection\Exception\AutowiringFailedException');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ public function testUnusedBinding()
$pass->process($container);
}

/**
* @group issue-32995
*
* @runInSeparateProcess https://github.com/symfony/symfony/issues/32995
*/
public function testMissingParent()
{
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -893,11 +893,6 @@ public function testInlineSelfRef()
$this->assertStringEqualsFile(self::$fixturesPath.'/php/services_inline_self_ref.php', $dumper->dump(['class' => 'Symfony_DI_PhpDumper_Test_Inline_Self_Ref']));
}

/**
* @group issue-32995
*
* @runInSeparateProcess https://github.com/symfony/symfony/issues/32995
*/
public function testHotPathOptimizations()
{
$container = include self::$fixturesPath.'/containers/container_inline_requires.php';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,6 @@ public function testRegisterClasses()
);
}

/**
* @group issue-32995
*
* @runInSeparateProcess https://github.com/symfony/symfony/issues/32995
*/
public function testRegisterClassesWithExclude()
{
$container = new ContainerBuilder();
Expand Down Expand Up @@ -141,11 +136,6 @@ public function testRegisterClassesWithExclude()
);
}

/**
* @group issue-32995
*
* @runInSeparateProcess https://github.com/symfony/symfony/issues/32995
*/
public function testNestedRegisterClasses()
{
$container = new ContainerBuilder();
Expand Down Expand Up @@ -174,11 +164,6 @@ public function testNestedRegisterClasses()
$this->assertFalse($alias->isPrivate());
}

/**
* @group issue-32995
*
* @runInSeparateProcess https://github.com/symfony/symfony/issues/32995
*/
public function testMissingParentClass()
{
$container = new ContainerBuilder();
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Process/Tests/ProcessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function testThatProcessDoesNotThrowWarningDuringRun()
$process = $this->getProcessForCode('sleep(3)');
$process->run();
$actualError = error_get_last();
$this->assertEquals('Test Error', $actualError['message']);
$this->assertEquals('Test Error', $actualError['message'], print_r($actualError, true));
$this->assertEquals(E_USER_NOTICE, $actualError['type']);
}

Expand Down
0