Skip to content

Commit bc16f04

Browse files
committed
dbg
1 parent dc0b005 commit bc16f04

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tests/tests/TestBehatTags.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,19 @@ private function run_behat_tags_script( $env = '' ) {
5353

5454
$command = '';
5555
if ( ! empty( $env ) ) {
56-
// putenv() can be unreliable, especially on Windows.
57-
// Prepending the variable to the command is a more robust cross-platform solution.
56+
// putenv() can be unreliable. Prepending the variable to the command is more robust.
5857
if ( DIRECTORY_SEPARATOR === '\\' ) { // Windows
59-
// Note: `set` is internal to `cmd.exe` and works on the subsequent command after `&&`.
60-
$command = 'set ' . escapeshellarg( $env ) . ' && ';
58+
// `set` is internal to `cmd.exe`. Do not escape the $env variable, as it's from a trusted
59+
// data provider and `escapeshellarg` adds quotes that `set` doesn't understand.
60+
$command = 'set ' . $env . ' && ';
6161
} else {
6262
// On Unix-like systems, this sets the variable for the duration of the command.
6363
$command = $env . ' ';
6464
}
6565
}
6666

6767
$command = 'cd ' . escapeshellarg( $this->temp_dir ) . ' && ' . $command . $php_run;
68+
echo "Executing Command: {$command}\n";
6869
$output = exec( $command );
6970

7071
return $output;
@@ -238,6 +239,9 @@ public function test_behat_tags_extension(): void {
238239

239240
$expected = '--tags=' . implode( '&&', array_merge( array( '~@github-api', '~@broken' ), $expecteds ) );
240241
$output = $this->run_behat_tags_script();
242+
echo "Imagick Loaded in Test: " . ( extension_loaded( 'imagick' ) ? 'Yes' : 'No' ) . "\n";
243+
echo "Expected: {$expected}\n";
244+
echo "Actual: {$output}\n";
241245
$this->assertSame( $expected, $output );
242246

243247
putenv( false === $env_github_token ? 'GITHUB_TOKEN' : "GITHUB_TOKEN=$env_github_token" );

0 commit comments

Comments
 (0)