Skip to content

Commit 8b1358f

Browse files
committed
Fixing tests so custom URIs in other tests no longer break us.
1 parent b3287a7 commit 8b1358f

3 files changed

Lines changed: 8 additions & 35 deletions

File tree

tests/system/HTTP/ResponseTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ protected function setUp(): void
2121
public function tearDown(): void
2222
{
2323
$_SERVER = $this->server;
24+
Config::reset();
2425
}
2526

2627
public function testCanSetStatusCode()

tests/system/Helpers/FormHelperTest.php

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -173,41 +173,6 @@ public function testFormOpenWithHidden()
173173
$this->assertEquals($expected, form_open('foo/bar', $attributes, $hidden));
174174
}
175175

176-
// ------------------------------------------------------------------------
177-
//FIXME This needs dynamic filters to complete
178-
// public function testFormOpenWithCSRF()
179-
// {
180-
// $config = new App();
181-
// $config->baseURL = '';
182-
// $config->indexPage = 'index.php';
183-
// $request = Services::request($config);
184-
// $request->uri = new URI('http://example.com/');
185-
//
186-
// Services::injectMock('request', $request);
187-
//
188-
// $filters = Services::filters();
189-
// $filters->globals['before'][] = 'csrf'; // force CSRF
190-
// $before = $filters->globals['before'];
191-
//
192-
// $Value = csrf_hash();
193-
// $Name = csrf_token();
194-
// $expected = <<<EOH
195-
//<form action="http://example.com/index.php/foo/bar" name="form" id="form" method="POST" accept-charset="utf-8">
196-
//<input type="hidden" name="foo" value="bar" style="display: none;" />
197-
//<input type="hidden" name="$Name" value="$Value" style="display: none;" />
198-
//
199-
//EOH;
200-
//
201-
// $attributes = [
202-
// 'name' => 'form',
203-
// 'id' => 'form',
204-
// 'method' => 'POST'
205-
// ];
206-
// $hidden = [
207-
// 'foo' => 'bar'
208-
// ];
209-
// $this->assertEquals($expected, form_open('foo/bar', $attributes, $hidden));
210-
// }
211176
// ------------------------------------------------------------------------
212177
public function testFormOpenMultipart()
213178
{

tests/system/Helpers/URLHelperTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ protected function setUp(): void
1919
Services::reset();
2020
}
2121

22+
public function tearDown()
23+
{
24+
parent::tearDown();
25+
26+
$_SERVER = [];
27+
}
28+
2229
//--------------------------------------------------------------------
2330
// Test site_url
2431

0 commit comments

Comments
 (0)