Skip to content

Commit d3566ca

Browse files
committed
minor #58374 Remove useless parent method calls in tests (alexandre-daubois)
This PR was merged into the 7.2 branch. Discussion ---------- Remove useless parent method calls in tests | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT The vast majority of tests don't call these parent methods, because they are no op. There are a few places where they are called, let's remove them? Commits ------- b54596f604 Remove useless parent method calls in tests
2 parents 8e61eab + 1028e55 commit d3566ca

7 files changed

+0
-12
lines changed

Tests/Session/Flash/AutoExpireFlashBagTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class AutoExpireFlashBagTest extends TestCase
2727

2828
protected function setUp(): void
2929
{
30-
parent::setUp();
3130
$this->bag = new FlashBag();
3231
$this->array = ['new' => ['notice' => ['A previous flash message']]];
3332
$this->bag->initialize($this->array);
@@ -36,7 +35,6 @@ protected function setUp(): void
3635
protected function tearDown(): void
3736
{
3837
unset($this->bag);
39-
parent::tearDown();
4038
}
4139

4240
public function testInitialize()

Tests/Session/Flash/FlashBagTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class FlashBagTest extends TestCase
2727

2828
protected function setUp(): void
2929
{
30-
parent::setUp();
3130
$this->bag = new FlashBag();
3231
$this->array = ['notice' => ['A previous flash message']];
3332
$this->bag->initialize($this->array);
@@ -36,7 +35,6 @@ protected function setUp(): void
3635
protected function tearDown(): void
3736
{
3837
unset($this->bag);
39-
parent::tearDown();
4038
}
4139

4240
public function testInitialize()

Tests/Session/Storage/Handler/AbstractRedisSessionHandlerTestCase.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ abstract protected function createRedisClient(string $host): \Redis|Relay|\Redis
3131

3232
protected function setUp(): void
3333
{
34-
parent::setUp();
35-
3634
if (!\extension_loaded('redis')) {
3735
self::markTestSkipped('Extension redis required.');
3836
}

Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ class MemcachedSessionHandlerTest extends TestCase
3030

3131
protected function setUp(): void
3232
{
33-
parent::setUp();
34-
3533
if (version_compare(phpversion('memcached'), '2.2.0', '>=') && version_compare(phpversion('memcached'), '3.0.0b1', '<')) {
3634
$this->markTestSkipped('Tests can only be run with memcached extension 2.1.0 or lower, or 3.0.0b1 or higher');
3735
}

Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ class MongoDbSessionHandlerTest extends TestCase
4444

4545
protected function setUp(): void
4646
{
47-
parent::setUp();
48-
4947
$this->manager = new Manager('mongodb://'.getenv('MONGODB_HOST'));
5048

5149
try {

Tests/Session/Storage/Handler/PdoSessionHandlerTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ protected function tearDown(): void
3030
if ($this->dbFile) {
3131
@unlink($this->dbFile);
3232
}
33-
parent::tearDown();
3433
}
3534

3635
protected function getPersistentSqliteDsn()

Tests/Session/Storage/MetadataBagTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class MetadataBagTest extends TestCase
2626

2727
protected function setUp(): void
2828
{
29-
parent::setUp();
3029
$this->bag = new MetadataBag();
3130
$this->array = [MetadataBag::CREATED => 1234567, MetadataBag::UPDATED => 12345678, MetadataBag::LIFETIME => 0];
3231
$this->bag->initialize($this->array);

0 commit comments

Comments
 (0)