Skip to content

Commit

Permalink
Skip test when xdebug.mode=off is configured
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Mar 23, 2024
1 parent 588a1a1 commit 174dca9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/RuntimeTest.php
Expand Up @@ -11,6 +11,7 @@

use const PHP_SAPI;
use const PHP_VERSION;
use function ini_get;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
use PHPUnit\Framework\TestCase;
Expand Down Expand Up @@ -117,6 +118,10 @@ public function testGetCurrentSettingsReturnsEmptyDiffIfNoValuesArePassed(): voi
#[RequiresPhpExtension('xdebug')]
public function testGetCurrentSettingsReturnsCorrectDiffIfXdebugValuesArePassed(): void
{
if (ini_get('xdebug.mode') === '') {
$this->markTestSkipped('xdebug.mode must not be set to "off"');
}

$this->assertIsArray((new Runtime)->getCurrentSettings(['xdebug.mode']));
$this->assertArrayHasKey('xdebug.mode', (new Runtime)->getCurrentSettings(['xdebug.mode']));
}
Expand Down

0 comments on commit 174dca9

Please sign in to comment.