Skip to content

Commit

Permalink
PHPUnit: set “processIsolation="true"” in conf instead of each test
Browse files Browse the repository at this point in the history
  • Loading branch information
alexislefebvre committed Oct 4, 2022
1 parent 5631c43 commit 5bf63d1
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 12 deletions.
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
beStrictAboutOutputDuringTests="true"
executionOrder="random"
resolveDependencies="true"
processIsolation="true"
>

<php>
Expand Down
1 change: 0 additions & 1 deletion tests/Test/ConfigEventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
* Tests/App/AppKernel.php.
* So it must be loaded in a separate process.
*
* @runTestsInSeparateProcesses
* @preserveGlobalState disabled
* @IgnoreAnnotation("dataProvider")
*
Expand Down
1 change: 0 additions & 1 deletion tests/Test/ConfigMysqlCacheDbTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
* Tests/App/AppKernel.php.
* So it must be loaded in a separate process.
*
* @runTestsInSeparateProcesses
* @preserveGlobalState disabled
* @IgnoreAnnotation("group")
*
Expand Down
1 change: 0 additions & 1 deletion tests/Test/ConfigMysqlKeepDatabaseAndSchemaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
* Tests/App/AppKernel.php.
* So it must be loaded in a separate process.
*
* @runTestsInSeparateProcesses
* @preserveGlobalState disabled
* @IgnoreAnnotation("group")
*
Expand Down
1 change: 0 additions & 1 deletion tests/Test/ConfigMysqlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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")
*
Expand Down
1 change: 0 additions & 1 deletion tests/Test/ConfigMysqlUrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
* Tests/App/AppKernel.php.
* So it must be loaded in a separate process.
*
* @runTestsInSeparateProcesses
* @preserveGlobalState disabled
*
* @internal
Expand Down
1 change: 0 additions & 1 deletion tests/Test/ConfigPgsqlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
* Tests/App/AppKernel.php.
* So it must be loaded in a separate process.
*
* @runTestsInSeparateProcesses
* @preserveGlobalState disabled
*
* @internal
Expand Down
1 change: 0 additions & 1 deletion tests/Test/ConfigPhpcrTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
* Tests/App/AppKernel.php.
* So it must be loaded in a separate process.
*
* @runTestsInSeparateProcesses
* @preserveGlobalState disabled
*
* @internal
Expand Down
6 changes: 3 additions & 3 deletions tests/Test/ConfigSqliteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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);
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion tests/Test/ConfigSqliteUrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 0 additions & 1 deletion tests/Test/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5bf63d1

Please sign in to comment.