Skip to content

Commit

Permalink
Fix --debug flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Luc45 committed Jan 18, 2024
1 parent fa7805c commit 57a4e07
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions _tests/QITSelfTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,17 @@ class Context {
public static $theme_slug = 'bistro';
}

Context::$action = $GLOBALS['argv'][1] ?? 'run';
Context::$suite = $GLOBALS['argv'][2] ?? null;
Context::$test = $GLOBALS['argv'][3] ?? null;
$params = $GLOBALS['argv'];

if ( in_array( '--debug', $GLOBALS['argv'], true ) ) {
if ( ( $debugKey = array_search( '--debug', $params, true ) ) !== false ) {
Context::$debug_mode = true;
unset( $params[ $debugKey ] );
}

Context::$action = $params[1] ?? 'run';
Context::$suite = $params[2] ?? null;
Context::$test = $params[3] ?? null;

require_once __DIR__ . '/test-result-parser.php';
require_once __DIR__ . '/ParallelOutput.php';

Expand Down

0 comments on commit 57a4e07

Please sign in to comment.