Skip to content

Commit 9a624cd

Browse files
committed
test: isolate CorsTest to prevent global state pollution
1 parent cbb953c commit 9a624cd

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

tests/system/HTTP/CorsTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,22 @@
1414
namespace CodeIgniter\HTTP;
1515

1616
use CodeIgniter\Test\CIUnitTestCase;
17+
use PHPUnit\Framework\Attributes\BackupGlobals;
1718
use PHPUnit\Framework\Attributes\Group;
1819

1920
/**
2021
* @internal
2122
*/
23+
#[BackupGlobals(true)]
2224
#[Group('Others')]
2325
final class CorsTest extends CIUnitTestCase
2426
{
27+
protected function setUp(): void
28+
{
29+
$this->resetServices();
30+
parent::setUp();
31+
}
32+
2533
/**
2634
* @param array{
2735
* allowedOrigins?: list<string>,

0 commit comments

Comments
 (0)