Skip to content

Commit b357e47

Browse files
committed
update tests
1 parent 88a842f commit b357e47

3 files changed

Lines changed: 23 additions & 3 deletions

File tree

tests/system/CodeIgniterTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
use Tests\Support\Filters\Customfilter;
2828

2929
/**
30+
* @runTestsInSeparateProcesses
31+
*
3032
* @backupGlobals enabled
3133
*
3234
* @internal

tests/system/Helpers/URLHelper/MiscUrlTest.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,19 @@ protected function tearDown(): void
5252
$_SERVER = [];
5353
}
5454

55+
/**
56+
* @runInSeparateProcess
57+
* @preserveGlobalState disabled
58+
*
59+
* @group SeparateProcess
60+
*/
5561
public function testPreviousURLUsesSessionFirst(): void
5662
{
5763
$uri1 = 'http://example.com/one?two';
5864
$uri2 = 'http://example.com/two?foo';
5965

60-
$_SERVER['HTTP_REFERER'] = $uri1;
61-
$_SESSION['_ci_previous_url'] = $uri2;
66+
$_SERVER['HTTP_REFERER'] = $uri1;
67+
session()->set('_ci_previous_url', $uri2);
6268

6369
$this->config->baseURL = 'http://example.com/public';
6470

@@ -80,6 +86,12 @@ private function createRequest(string $uri): void
8086
Factories::injectMock('config', 'App', $this->config);
8187
}
8288

89+
/**
90+
* @runInSeparateProcess
91+
* @preserveGlobalState disabled
92+
*
93+
* @group SeparateProcess
94+
*/
8395
public function testPreviousURLUsesRefererIfNeeded(): void
8496
{
8597
$uri1 = 'http://example.com/one?two';

tests/system/View/ParserPluginTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,18 @@ public function testCurrentURL(): void
4242
$this->assertSame(current_url(), $this->parser->renderString($template));
4343
}
4444

45+
/**
46+
* @runInSeparateProcess
47+
* @preserveGlobalState disabled
48+
*
49+
* @group SeparateProcess
50+
*/
4551
public function testPreviousURL(): void
4652
{
4753
$template = '{+ previous_url +}';
4854

4955
// Ensure a previous URL exists to work with.
50-
$_SESSION['_ci_previous_url'] = 'http://example.com/foo';
56+
session()->set('_ci_previous_url', 'http://example.com/foo');
5157

5258
$this->assertSame(previous_url(), $this->parser->renderString($template));
5359
}

0 commit comments

Comments
 (0)