Skip to content

Commit

Permalink
Tests: run each dataset separately.
Browse files Browse the repository at this point in the history
To avoid test order, changes to run each dataset in a separate process, which each test starts with the static `$id_counters` equal to an empty array.
  • Loading branch information
hellofromtonya committed Oct 24, 2023
1 parent 7a32e26 commit 5aac204
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/phpunit/tests/functions/wpUniquePrefixedId.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
*
* @group functions.php
* @covers ::wp_unique_prefixed_id
* @runTestsInSeparateProcesses
* @preserveGlobalState disabled
*/
class Tests_Functions_WpUniquePrefixedId extends WP_UnitTestCase {

Expand All @@ -21,6 +19,9 @@ class Tests_Functions_WpUniquePrefixedId extends WP_UnitTestCase {
*
* @dataProvider data_should_create_unique_prefixed_ids
*
* @runInSeparateProcess
* @preserveGlobalState disabled
*
* @param mixed $prefix The prefix.
* @param array $expected The next two expected IDs.
*/
Expand Down Expand Up @@ -75,6 +76,9 @@ public function data_should_create_unique_prefixed_ids() {
*
* @dataProvider data_should_raise_notice_and_use_empty_string_prefix_when_nonstring_given
*
* @runInSeparateProcess
* @preserveGlobalState disabled
*
* @param mixed $non_string_prefix Non-string prefix.
* @param string $expected_message Expected notice message.
* @param string $expected_value Expected unique ID.
Expand Down

0 comments on commit 5aac204

Please sign in to comment.