From 5bf63d1ebcbaaaae3fddca432407c563ad7d7ee1 Mon Sep 17 00:00:00 2001 From: Alexis Lefebvre Date: Fri, 8 Jul 2022 15:03:12 +0200 Subject: [PATCH] =?UTF-8?q?PHPUnit:=20set=20=E2=80=9CprocessIsolation=3D"t?= =?UTF-8?q?rue"=E2=80=9D=20in=20conf=20instead=20of=20each=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- phpunit.xml.dist | 1 + tests/Test/ConfigEventsTest.php | 1 - tests/Test/ConfigMysqlCacheDbTest.php | 1 - tests/Test/ConfigMysqlKeepDatabaseAndSchemaTest.php | 1 - tests/Test/ConfigMysqlTest.php | 1 - tests/Test/ConfigMysqlUrlTest.php | 1 - tests/Test/ConfigPgsqlTest.php | 1 - tests/Test/ConfigPhpcrTest.php | 1 - tests/Test/ConfigSqliteTest.php | 6 +++--- tests/Test/ConfigSqliteUrlTest.php | 1 - tests/Test/ConfigTest.php | 1 - 11 files changed, 4 insertions(+), 12 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 6cba6fbb..32c36949 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -9,6 +9,7 @@ beStrictAboutOutputDuringTests="true" executionOrder="random" resolveDependencies="true" + processIsolation="true" > diff --git a/tests/Test/ConfigEventsTest.php b/tests/Test/ConfigEventsTest.php index 9238e600..17fe6997 100644 --- a/tests/Test/ConfigEventsTest.php +++ b/tests/Test/ConfigEventsTest.php @@ -30,7 +30,6 @@ * Tests/App/AppKernel.php. * So it must be loaded in a separate process. * - * @runTestsInSeparateProcesses * @preserveGlobalState disabled * @IgnoreAnnotation("dataProvider") * diff --git a/tests/Test/ConfigMysqlCacheDbTest.php b/tests/Test/ConfigMysqlCacheDbTest.php index 53eb64e9..d9a48f33 100644 --- a/tests/Test/ConfigMysqlCacheDbTest.php +++ b/tests/Test/ConfigMysqlCacheDbTest.php @@ -31,7 +31,6 @@ * Tests/App/AppKernel.php. * So it must be loaded in a separate process. * - * @runTestsInSeparateProcesses * @preserveGlobalState disabled * @IgnoreAnnotation("group") * diff --git a/tests/Test/ConfigMysqlKeepDatabaseAndSchemaTest.php b/tests/Test/ConfigMysqlKeepDatabaseAndSchemaTest.php index 25782ad0..3dda32b2 100644 --- a/tests/Test/ConfigMysqlKeepDatabaseAndSchemaTest.php +++ b/tests/Test/ConfigMysqlKeepDatabaseAndSchemaTest.php @@ -30,7 +30,6 @@ * Tests/App/AppKernel.php. * So it must be loaded in a separate process. * - * @runTestsInSeparateProcesses * @preserveGlobalState disabled * @IgnoreAnnotation("group") * diff --git a/tests/Test/ConfigMysqlTest.php b/tests/Test/ConfigMysqlTest.php index 053b6f1a..df0dd323 100644 --- a/tests/Test/ConfigMysqlTest.php +++ b/tests/Test/ConfigMysqlTest.php @@ -44,7 +44,6 @@ class_alias('\Doctrine\Persistence\ObjectManager', '\Doctrine\Common\Persistence * Tests/App/AppKernel.php. * So it must be loaded in a separate process. * - * @runTestsInSeparateProcesses * @preserveGlobalState disabled * @IgnoreAnnotation("group") * diff --git a/tests/Test/ConfigMysqlUrlTest.php b/tests/Test/ConfigMysqlUrlTest.php index ebbf2b3d..85fc6e75 100644 --- a/tests/Test/ConfigMysqlUrlTest.php +++ b/tests/Test/ConfigMysqlUrlTest.php @@ -29,7 +29,6 @@ * Tests/App/AppKernel.php. * So it must be loaded in a separate process. * - * @runTestsInSeparateProcesses * @preserveGlobalState disabled * * @internal diff --git a/tests/Test/ConfigPgsqlTest.php b/tests/Test/ConfigPgsqlTest.php index 8cbd7ee3..dc84895a 100644 --- a/tests/Test/ConfigPgsqlTest.php +++ b/tests/Test/ConfigPgsqlTest.php @@ -30,7 +30,6 @@ * Tests/App/AppKernel.php. * So it must be loaded in a separate process. * - * @runTestsInSeparateProcesses * @preserveGlobalState disabled * * @internal diff --git a/tests/Test/ConfigPhpcrTest.php b/tests/Test/ConfigPhpcrTest.php index 70d2173e..02742fd2 100644 --- a/tests/Test/ConfigPhpcrTest.php +++ b/tests/Test/ConfigPhpcrTest.php @@ -32,7 +32,6 @@ * Tests/App/AppKernel.php. * So it must be loaded in a separate process. * - * @runTestsInSeparateProcesses * @preserveGlobalState disabled * * @internal diff --git a/tests/Test/ConfigSqliteTest.php b/tests/Test/ConfigSqliteTest.php index cbfe3cf8..5f2238ca 100644 --- a/tests/Test/ConfigSqliteTest.php +++ b/tests/Test/ConfigSqliteTest.php @@ -30,9 +30,9 @@ class_alias('\Doctrine\Persistence\ObjectManager', '\Doctrine\Common\Persistence use Liip\TestFixturesBundle\Services\DatabaseTools\AbstractDatabaseTool; use Liip\TestFixturesBundle\Services\DatabaseTools\ORMSqliteDatabaseTool; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; +use function count; /** - * @runTestsInSeparateProcesses * @preserveGlobalState disabled * * @IgnoreAnnotation("depends") @@ -370,7 +370,7 @@ public function testLoadFixturesFilesWithPurgeModeTruncate(): void // There are 10 users in the database $this->assertSame( 10, - \count($users) + count($users) ); $this->databaseTool->setPurgeMode(ORMPurger::PURGE_MODE_TRUNCATE); @@ -393,7 +393,7 @@ public function testLoadFixturesFilesWithPurgeModeTruncate(): void // There are only 10 users in the database $this->assertSame( 10, - \count($users) + count($users) ); // Auto-increment hasn't been altered, so ids start from 11 diff --git a/tests/Test/ConfigSqliteUrlTest.php b/tests/Test/ConfigSqliteUrlTest.php index 414b3438..a26c6123 100644 --- a/tests/Test/ConfigSqliteUrlTest.php +++ b/tests/Test/ConfigSqliteUrlTest.php @@ -25,7 +25,6 @@ class_alias('\Doctrine\Persistence\ObjectManager', '\Doctrine\Common\Persistence /** * Run SQLite tests by using an URL for Doctrine. * - * @runTestsInSeparateProcesses * @preserveGlobalState disabled * * @IgnoreAnnotation("depends") diff --git a/tests/Test/ConfigTest.php b/tests/Test/ConfigTest.php index ea566459..88d20391 100644 --- a/tests/Test/ConfigTest.php +++ b/tests/Test/ConfigTest.php @@ -37,7 +37,6 @@ class_alias('\Doctrine\Persistence\ObjectManager', '\Doctrine\Common\Persistence * Tests/App/AppKernel.php. * So it must be loaded in a separate process. * - * @runTestsInSeparateProcesses * @preserveGlobalState disabled * * Avoid conflict with PHPUnit annotation when reading QueryCount