Skip to content

Commit 4fca27d

Browse files
committed
Change visibility of setUp and tearDown to original protected
1 parent e6d27b4 commit 4fca27d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+52
-51
lines changed

admin/module/tests/_support/DatabaseTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ class DatabaseTestCase extends CIUnitTestCase
4242
*/
4343
protected $namespace = 'Tests\Support';
4444

45-
public function setUp(): void
45+
protected function setUp(): void
4646
{
4747
parent::setUp();
4848

4949
// Extra code to run before each test
5050
}
5151

52-
public function tearDown(): void
52+
protected function tearDown(): void
5353
{
5454
parent::tearDown();
5555

admin/module/tests/_support/SessionTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class SessionTestCase extends CIUnitTestCase
1414
*/
1515
protected $session;
1616

17-
public function setUp(): void
17+
protected function setUp(): void
1818
{
1919
parent::setUp();
2020

admin/module/tests/database/ExampleDatabaseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class ExampleDatabaseTest extends \Tests\Support\DatabaseTestCase
66
{
7-
public function setUp(): void
7+
protected function setUp(): void
88
{
99
parent::setUp();
1010

admin/module/tests/session/ExampleSessionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
class ExampleSessionTest extends \Tests\Support\SessionTestCase
44
{
5-
public function setUp(): void
5+
protected function setUp(): void
66
{
77
parent::setUp();
88
}

admin/module/tests/unit/ExampleTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
class ExampleTest extends \CodeIgniter\Test\CIUnitTestCase
44
{
5-
public function setUp(): void
5+
protected function setUp(): void
66
{
77
parent::setUp();
88
}

admin/starter/tests/_support/DatabaseTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ class DatabaseTestCase extends CIUnitTestCase
4242
*/
4343
protected $namespace = 'Tests\Support';
4444

45-
public function setUp(): void
45+
protected function setUp(): void
4646
{
4747
parent::setUp();
4848

4949
// Extra code to run before each test
5050
}
5151

52-
public function tearDown(): void
52+
protected function tearDown(): void
5353
{
5454
parent::tearDown();
5555

admin/starter/tests/_support/SessionTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class SessionTestCase extends CIUnitTestCase
1414
*/
1515
protected $session;
1616

17-
public function setUp(): void
17+
protected function setUp(): void
1818
{
1919
parent::setUp();
2020

admin/starter/tests/database/ExampleDatabaseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class ExampleDatabaseTest extends \Tests\Support\DatabaseTestCase
66
{
7-
public function setUp(): void
7+
protected function setUp(): void
88
{
99
parent::setUp();
1010

admin/starter/tests/session/ExampleSessionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
class ExampleSessionTest extends \Tests\Support\SessionTestCase
44
{
5-
public function setUp(): void
5+
protected function setUp(): void
66
{
77
parent::setUp();
88
}

admin/starter/tests/unit/HealthTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class HealthTest extends \CodeIgniter\Test\CIUnitTestCase
66
{
7-
public function setUp(): void
7+
protected function setUp(): void
88
{
99
parent::setUp();
1010
}

tests/system/CLI/CLITest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ protected function setUp(): void
1818
$this->stream_filter = stream_filter_append(STDOUT, 'CITestStreamFilter');
1919
}
2020

21-
public function tearDown(): void
21+
protected function tearDown(): void
2222
{
2323
stream_filter_remove($this->stream_filter);
2424
}

tests/system/CLI/CommandRunnerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ protected function setUp(): void
4242
$this->streamFilter = stream_filter_append(STDERR, 'CITestStreamFilter');
4343
}
4444

45-
public function tearDown(): void
45+
protected function tearDown(): void
4646
{
4747
stream_filter_remove($this->streamFilter);
4848
}

tests/system/CLI/ConsoleTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected function setUp(): void
3939
$this->app = new MockCodeIgniter(new MockCLIConfig());
4040
}
4141

42-
public function tearDown(): void
42+
protected function tearDown(): void
4343
{
4444
stream_filter_remove($this->stream_filter);
4545
}

tests/system/Cache/CacheFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ protected function setUp(): void
2323
$this->config->storePath .= self::$directory;
2424
}
2525

26-
public function tearDown(): void
26+
protected function tearDown(): void
2727
{
2828
if (is_dir($this->config->storePath)) {
2929
chmod($this->config->storePath, 0777);

tests/system/Cache/Handlers/FileHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protected function setUp(): void
4646
$this->fileHandler->initialize();
4747
}
4848

49-
public function tearDown(): void
49+
protected function tearDown(): void
5050
{
5151
parent::tearDown();
5252

tests/system/Cache/Handlers/MemcachedHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ protected function setUp(): void
3737
$this->memcachedHandler->initialize();
3838
}
3939

40-
public function tearDown(): void
40+
protected function tearDown(): void
4141
{
4242
foreach (self::getKeyArray() as $key) {
4343
$this->memcachedHandler->delete($key);

tests/system/Cache/Handlers/PredisHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ protected function setUp(): void
3636
$this->PredisHandler->initialize();
3737
}
3838

39-
public function tearDown(): void
39+
protected function tearDown(): void
4040
{
4141
foreach (self::getKeyArray() as $key) {
4242
$this->PredisHandler->delete($key);

tests/system/Cache/Handlers/RedisHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ protected function setUp(): void
3636
$this->redisHandler->initialize();
3737
}
3838

39-
public function tearDown(): void
39+
protected function tearDown(): void
4040
{
4141
foreach (self::getKeyArray() as $key) {
4242
$this->redisHandler->delete($key);

tests/system/CodeIgniterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protected function setUp(): void
3535
$this->codeigniter = new MockCodeIgniter($config);
3636
}
3737

38-
public function tearDown(): void
38+
protected function tearDown(): void
3939
{
4040
parent::tearDown();
4141

tests/system/Commands/ClearCacheTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ protected function setUp(): void
2323
Services::injectMock('cache', CacheFactory::getHandler(config('Cache')));
2424
}
2525

26-
public function tearDown(): void
26+
protected function tearDown(): void
2727
{
2828
stream_filter_remove($this->streamFilter);
2929
}

tests/system/Commands/InfoCacheTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ protected function setUp(): void
2323
Services::injectMock('cache', CacheFactory::getHandler(config('Cache')));
2424
}
2525

26-
public function tearDown(): void
26+
protected function tearDown(): void
2727
{
2828
stream_filter_remove($this->streamFilter);
2929

tests/system/Commands/SessionsCommandsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ protected function setUp(): void
1919
$this->streamFilter = stream_filter_append(STDERR, 'CITestStreamFilter');
2020
}
2121

22-
public function tearDown(): void
22+
protected function tearDown(): void
2323
{
2424
stream_filter_remove($this->streamFilter);
2525

tests/system/Config/ServicesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected function setUp(): void
4949
$this->config = new App();
5050
}
5151

52-
public function tearDown(): void
52+
protected function tearDown(): void
5353
{
5454
$_SERVER = $this->original;
5555
Services::reset();

tests/system/Database/DatabaseTestCase/DatabaseTestCaseMigrationOnce1Test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class DatabaseTestCaseMigrationOnce1Test extends CIUnitTestCase
4343
'Tests\Support\MigrationTestMigrations',
4444
];
4545

46-
public function setUp(): void
46+
protected function setUp(): void
4747
{
4848
Services::autoloader()->addNamespace('Tests\Support\MigrationTestMigrations', SUPPORTPATH . 'MigrationTestMigrations');
4949

tests/system/Database/DatabaseTestCase/DatabaseTestCaseMigrationOnce2Test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class DatabaseTestCaseMigrationOnce2Test extends CIUnitTestCase
4242
'Tests\Support\MigrationTestMigrations',
4343
];
4444

45-
public function setUp(): void
45+
protected function setUp(): void
4646
{
4747
Services::autoloader()->addNamespace('Tests\Support\MigrationTestMigrations', SUPPORTPATH . 'MigrationTestMigrations');
4848

tests/system/Database/DatabaseTestCaseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class DatabaseTestCaseTest extends CIUnitTestCase
4747
'Tests\Support\MigrationTestMigrations',
4848
];
4949

50-
public function setUp(): void
50+
protected function setUp(): void
5151
{
5252
if (! self::$loaded) {
5353
Services::autoloader()->addNamespace('Tests\Support\MigrationTestMigrations', SUPPORTPATH . 'MigrationTestMigrations');

tests/system/Database/Live/DEBugTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function testDBDebugFalse()
2828
$this->assertEquals(false, $result);
2929
}
3030

31-
public function tearDown(): void
31+
protected function tearDown(): void
3232
{
3333
$this->setPrivateProperty($this->db, 'DBDebug', true);
3434
parent::tearDown();

tests/system/Database/Live/GetNumRowsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class GetNumRowsTest extends CIUnitTestCase
1919
*
2020
* @see \CodeIgniter\Test\CIDatabaseTestCase::setUp()
2121
*/
22-
public function setUp(): void
22+
protected function setUp(): void
2323
{
2424
parent::setUp();
2525
}
@@ -30,7 +30,7 @@ public function setUp(): void
3030
*
3131
* @see \CodeIgniter\Test\CIDatabaseTestCase::tearDown()
3232
*/
33-
public function tearDown(): void
33+
protected function tearDown(): void
3434
{
3535
parent::tearDown();
3636
}

tests/system/Database/Live/PretendTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class PretendTest extends CIUnitTestCase
1313
{
1414
use DatabaseTestTrait;
1515

16-
public function tearDown(): void
16+
protected function tearDown(): void
1717
{
1818
// We share `$this->db` in testing, so we need to restore the state.
1919
$this->db->pretend(false);

tests/system/Database/Live/SQLite/AlterTableTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class AlterTableTest extends CIUnitTestCase
3838
*/
3939
protected $forge;
4040

41-
public function setUp(): void
41+
protected function setUp(): void
4242
{
4343
parent::setUp();
4444

tests/system/Database/Migrations/MigrationRunnerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class MigrationRunnerTest extends CIUnitTestCase
2727
protected $start;
2828
protected $config;
2929

30-
public function setUp(): void
30+
protected function setUp(): void
3131
{
3232
parent::setUp();
3333

tests/system/Database/Migrations/MigrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class MigrationTest extends CIUnitTestCase
1010
{
1111
use DatabaseTestTrait;
1212

13-
public function setUp(): void
13+
protected function setUp(): void
1414
{
1515
parent::setUp();
1616
}

tests/system/Files/FileWithVfsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ protected function setUp(): void
2929
$this->file = new File($this->start . 'able/apple.php');
3030
}
3131

32-
public function tearDown(): void
32+
protected function tearDown(): void
3333
{
3434
parent::tearDown();
3535

tests/system/HTTP/DownloadResponseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
class DownloadResponseTest extends CIUnitTestCase
1212
{
13-
public function tearDown(): void
13+
protected function tearDown(): void
1414
{
1515
if (isset($_SERVER['HTTP_USER_AGENT'])) {
1616
unset($_SERVER['HTTP_USER_AGENT']);

tests/system/HTTP/Files/FileMovingTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ protected function setUp(): void
2525
$_FILES = [];
2626
}
2727

28-
public function tearDown(): void
28+
protected function tearDown(): void
2929
{
3030
parent::tearDown();
3131
$this->root = null;

tests/system/HTTP/MessageTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ protected function setUp(): void
2222

2323
//--------------------------------------------------------------------
2424

25-
public function tearDown(): void
25+
protected function tearDown(): void
2626
{
2727
$this->message = null;
2828
unset($this->message);

tests/system/HTTP/NegotiateTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected function setUp(): void
3030

3131
//--------------------------------------------------------------------
3232

33-
public function tearDown(): void
33+
protected function tearDown(): void
3434
{
3535
$this->request = $this->negotiate = null;
3636
unset($this->request, $this->negotiate);

tests/system/HTTP/ResponseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ protected function setUp(): void
2222
$this->server = $_SERVER;
2323
}
2424

25-
public function tearDown(): void
25+
protected function tearDown(): void
2626
{
2727
$_SERVER = $this->server;
2828
Factories::reset('config');

tests/system/HTTP/URITest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ protected function setUp(): void
2020

2121
//--------------------------------------------------------------------
2222

23-
public function tearDown(): void
23+
protected function tearDown(): void
2424
{
2525
Factories::reset('config');
2626
}

tests/system/Helpers/URLHelper/CurrentUrlTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected function setUp(): void
4747
$_SERVER['SCRIPT_NAME'] = '/index.php';
4848
}
4949

50-
public function tearDown(): void
50+
protected function tearDown(): void
5151
{
5252
parent::tearDown();
5353

tests/system/Helpers/URLHelper/MiscUrlTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected function setUp(): void
3939
Factories::injectMock('config', 'App', $this->config);
4040
}
4141

42-
public function tearDown(): void
42+
protected function tearDown(): void
4343
{
4444
parent::tearDown();
4545

0 commit comments

Comments
 (0)