Skip to content
Merged
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
16 changes: 16 additions & 0 deletions tests/utils/skipif.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
require_once __DIR__ . '/basic.inc';
require_once __DIR__ . '/tools.php';

/**
* Disables SKIPIF caching (PHP 8.1+).
*/
function disable_skipif_caching()
{
if (PHP_VERSION_ID < 80100) {
return;
}

echo "nocache\n";
}

/**
* Skips the test if the topology is a sharded cluster.
*/
Expand Down Expand Up @@ -404,6 +416,10 @@ function skip_if_not_clean($databaseName = DATABASE_NAME, $collectionName = COLL
} catch (RuntimeException $e) {
exit("skip Could not drop '$databaseName.$collectionName': " . $e->getMessage());
}

/* Since this function modifies the state of the database, we need it to run
* each time before a test. */
disable_skipif_caching();
}

function skip_if_no_getmore_failpoint()
Expand Down