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

Remove workaround for testing with PHP 8 #344

Merged
merged 3 commits into from
Feb 17, 2021

Conversation

greg0ire
Copy link
Member

@greg0ire greg0ire commented Feb 14, 2021

Now that all dependencies support it, it should not be necessary to
pretend we are using PHP 7.4. Implies upgrading the CS lib.

@greg0ire greg0ire force-pushed the remove-php8-workaround branch from e06af0d to 532211d Compare February 14, 2021 12:19
We should use a version that is compatible with PHP 8
@greg0ire greg0ire force-pushed the remove-php8-workaround branch from 532211d to dc158f0 Compare February 14, 2021 12:26
Now that all dependencies support it, it should not be necessary to
pretend we are using PHP 7.4.
@greg0ire greg0ire force-pushed the remove-php8-workaround branch from dc158f0 to f256c0d Compare February 14, 2021 12:29
@@ -29,11 +31,13 @@ public function testInstantiatingWithoutManagerRegistry() : void
if (PHP_VERSION_ID >= 80000) {
$this->expectExceptionMessage(
<<<'MESSAGE'
Doctrine\Bundle\DoctrineBundle\Command\DoctrineCommand::__construct(): Argument #1 ($doctrine) must be of type Doctrine\Persistence\ManagerRegistry, null given, called in /home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/Command/LoadDataFixturesDoctrineCommand.php on line 49
Doctrine\Bundle\DoctrineBundle\Command\DoctrineCommand::__construct(): Argument #1 ($doctrine) must be of type Doctrine\Persistence\ManagerRegistry, null given, called in /home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/Command/LoadDataFixturesDoctrineCommand.php on line 51
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the line number relevant for the error message check? It seems like an unstable test when changes are happening.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is unstable indeed, I remember having to change it in the past. Let me try refactoring it.

@greg0ire greg0ire force-pushed the remove-php8-workaround branch 3 times, most recently from e040fa3 to d3a471d Compare February 17, 2021 07:47
We no longer assert the file and the line number in the test, which
should make it less flaky. Also, we regroup together the 2 cases which
makes it easier to understand the only thing that changes is the form of
the message we are trying to test.
@greg0ire greg0ire force-pushed the remove-php8-workaround branch from d3a471d to ff1a572 Compare February 17, 2021 07:53
@greg0ire
Copy link
Member Author

It looks like the integration tests are flaky 🤦

 There was 1 error:

1) Doctrine\Bundle\FixturesBundle\Tests\IntegrationTest::testRunCommandWithPurgeMode
Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: The "doctrine" service is private, you cannot replace it.

/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/vendor/symfony/dependency-injection/Container.php:169
/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/Tests/IntegrationTest.php:483

@greg0ire greg0ire merged commit 4c91d85 into doctrine:3.4.x Feb 17, 2021
@greg0ire greg0ire deleted the remove-php8-workaround branch February 17, 2021 14:14
@greg0ire greg0ire added this to the 3.4.1 milestone Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants