Skip to content

Replace explicit calls to Services::reset() in tests #5259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 30, 2021
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
2 changes: 1 addition & 1 deletion tests/system/CodeIgniterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ final class CodeIgniterTest extends CIUnitTestCase
protected function setUp(): void
{
parent::setUp();
Services::reset();
$this->resetServices();

$_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1';

Expand Down
4 changes: 2 additions & 2 deletions tests/system/CommonHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ final class CommonHelperTest extends CIUnitTestCase

protected function setUp(): void
{
Services::reset();
$this->resetServices();
parent::setUp();
$this->cleanUpDummyHelpers();
}
Expand All @@ -41,7 +41,7 @@ protected function tearDown(): void
{
parent::tearDown();
$this->cleanUpDummyHelpers();
Services::reset();
$this->resetServices();
}

private function createDummyHelpers(): void
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Config/ServicesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected function setUp(): void
protected function tearDown(): void
{
$_SERVER = $this->original;
Services::reset();
$this->resetServices();
}

public function testCanReplaceFrameworkServices()
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Filters/FiltersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ final class FiltersTest extends CIUnitTestCase
protected function setUp(): void
{
parent::setUp();
Services::reset();
$this->resetServices();

$defaults = [
'Config' => APPPATH . 'Config',
Expand Down
2 changes: 1 addition & 1 deletion tests/system/HTTP/CURLRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected function setUp(): void
{
parent::setUp();

Services::reset();
$this->resetServices();
$this->request = $this->getRequest();
}

Expand Down
6 changes: 3 additions & 3 deletions tests/system/HTTP/URITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ public function testSetBadSegmentSilent()

public function testBasedNoIndex()
{
Services::reset();
$this->resetServices();

$_SERVER['HTTP_HOST'] = 'example.com';
$_SERVER['REQUEST_URI'] = '/ci/v4/controller/method';
Expand All @@ -888,7 +888,7 @@ public function testBasedNoIndex()

public function testBasedWithIndex()
{
Services::reset();
$this->resetServices();

$_SERVER['HTTP_HOST'] = 'example.com';
$_SERVER['REQUEST_URI'] = '/ci/v4/index.php/controller/method';
Expand All @@ -915,7 +915,7 @@ public function testBasedWithIndex()

public function testForceGlobalSecureRequests()
{
Services::reset();
$this->resetServices();

$_SERVER['HTTP_HOST'] = 'example.com';
$_SERVER['REQUEST_URI'] = '/ci/v4/controller/method';
Expand Down
2 changes: 1 addition & 1 deletion tests/system/RESTful/ResourceControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected function setUp(): void
{
parent::setUp();

Services::reset();
$this->resetServices();

$_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1';

Expand Down
2 changes: 1 addition & 1 deletion tests/system/RESTful/ResourcePresenterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected function setUp(): void
{
parent::setUp();

Services::reset();
$this->resetServices();

$_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1';

Expand Down