Skip to content
Merged
Show file tree
Hide file tree
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
24 changes: 19 additions & 5 deletions tests/src/SimpleSAML/SessionHandlerPHPTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
namespace SimpleSAML\Test;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Depends;
use PHPUnit\Framework\Attributes\DoesNotPerformAssertions;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
use PHPUnit\Framework\Attributes\RunInSeparateProcess;
use SimpleSAML\{Configuration, SessionHandlerPHP};
Expand Down Expand Up @@ -50,6 +52,18 @@ protected function tearDown(): void
}


/**
*/
#[DoesNotPerformAssertions]
#[RequiresPhpExtension('xdebug')]
public function testXdebugMode(): void
{
if (!in_array('develop', xdebug_info('mode'))) {
$this->markTestSkipped('xdebug.mode != develop');
}
}


/**
*/
public function testGetSessionHandler(): void
Expand All @@ -62,7 +76,7 @@ public function testGetSessionHandler(): void

/**
*/
#[RequiresPhpExtension('xdebug')]
#[Depends('testXdebugMode')]
#[RunInSeparateProcess]
public function testSetCookie(): void
{
Expand All @@ -85,7 +99,7 @@ public function testSetCookie(): void

/**
*/
#[RequiresPhpExtension('xdebug')]
#[Depends('testXdebugMode')]
#[RunInSeparateProcess]
public function testSetCookieSameSiteNone(): void
{
Expand All @@ -105,7 +119,7 @@ public function testSetCookieSameSiteNone(): void

/**
*/
#[RequiresPhpExtension('xdebug')]
#[Depends('testXdebugMode')]
#[RunInSeparateProcess]
public function testSetCookieSameSiteLax(): void
{
Expand All @@ -125,7 +139,7 @@ public function testSetCookieSameSiteLax(): void

/**
*/
#[RequiresPhpExtension('xdebug')]
#[Depends('testXdebugMode')]
#[RunInSeparateProcess]
public function testSetCookieSameSiteStrict(): void
{
Expand All @@ -145,7 +159,7 @@ public function testSetCookieSameSiteStrict(): void

/**
*/
#[RequiresPhpExtension('xdebug')]
#[Depends('testXdebugMode')]
#[RunInSeparateProcess]
public function testRestorePrevious(): void
{
Expand Down
16 changes: 15 additions & 1 deletion tests/src/SimpleSAML/Utils/HTTPTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Depends;
use PHPUnit\Framework\Attributes\DoesNotPerformAssertions;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
use PHPUnit\Framework\Attributes\RunInSeparateProcess;
use SimpleSAML\{Configuration, Error, Utils};
Expand Down Expand Up @@ -446,7 +448,19 @@ public function testCheckURLAllowedWithRegexWithoutDelimiters(): void

/**
*/
#[DoesNotPerformAssertions]
#[RequiresPhpExtension('xdebug')]
public function testXdebugMode(): void
{
if (!in_array('develop', xdebug_info('mode'))) {
$this->markTestSkipped('xdebug.mode != develop');
}
}


/**
*/
#[Depends('testXdebugMode')]
#[RunInSeparateProcess]
public function testSetCookie(): void
{
Expand Down Expand Up @@ -528,7 +542,7 @@ public function testSetCookieInsecure(): void

/**
*/
#[RequiresPhpExtension('xdebug')]
#[Depends('testXdebugMode')]
#[RunInSeparateProcess]
public function testSetCookieSameSite(): void
{
Expand Down
Loading