1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-06-27 16:36:00 +00:00
wallabag/tests/functions.php

33 lines
793 B
PHP
Raw Permalink Normal View History

<?php
/*
* This files contains functions that are used in the tests, especially the bootstrap.php file.
*/
/**
* Returns true if the current test run is a partial run.
* A partial run is a run that only runs a subset of the tests using the --filter, --testsuite, --group or --exclude-group options.
*/
function isPartialRun(): bool
{
foreach ($_SERVER['argv'] as $arg) {
2025-04-05 14:01:48 +02:00
if (str_starts_with((string) $arg, '--filter')) {
return true;
}
2025-04-05 14:01:48 +02:00
if (str_starts_with((string) $arg, '--testsuite')) {
return true;
}
2025-04-05 14:01:48 +02:00
if (str_starts_with((string) $arg, '--group')) {
return true;
}
2025-04-05 14:01:48 +02:00
if (str_starts_with((string) $arg, '--exclude-group')) {
return true;
}
}
return false;
}