8000 minor #58374 Remove useless parent method calls in tests (alexandre-d… · symfony/symfony@d67a0bb · GitHub
[go: up one dir, main page]

Skip to content

Commit d67a0bb

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 ------- b54596f Remove useless parent method calls in tests
2 parents b4bde0a + b54596f commit d67a0bb

File tree

39 files changed

+0
-89
lines changed

39 files changed

+0
-89
lines changed

src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ class DoctrineExtensionTest extends TestCase
2828

2929
protected function setUp(): void
3030
{
31-
parent::setUp();
32-
3331
$this->extension = $this
3432
->getMockBuilder(AbstractDoctrineExtension::class)
3533
->onlyMethods([

src/Symfony/Bridge/Doctrine/Tests/Middleware/Debug/MiddlewareTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ class MiddlewareTest extends TestCase
3838

3939
protected function setUp(): void
4040
{
41-
parent::setUp();
42-
4341
if (!interface_exists(MiddlewareInterface::class)) {
4442
$this->markTestSkipped(\sprintf('%s needed to run this test', MiddlewareInterface::class));
4543
}

src/Symfony/Bridge/Twig/Tests/Extension/AbstractLayoutTestCase.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ protected function getExtensions()
5858
protected function tearDown(): void
5959
{
6060
\Locale::setDefault($this->defaultLocale);
61-
62-
parent::tearDown();
6361
}
6462

6563
protected function assertWidgetMatchesXpath(FormView $view, array $vars, $xpath)

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/UidTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ class UidTest extends AbstractWebTestCase
2020
{
2121
protected function setUp(): void
2222
{
23-
parent::setUp();
24-
2523
self::deleteTmpDir();
2624
}
2725

src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/WebProfilerExtensionTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ public static function assertSaneContainer(Container $container)
5454

5555
protected function setUp(): void
5656
{
57-
parent::setUp();
58-
5957
$this->kernel = $this->createMock(KernelInterface::class);
6058

6159
$profiler = $this->createMock(Profiler::class);
@@ -88,8 +86,6 @@ protected function setUp(): void
8886

8987
protected function tearDown(): void
9088
{
91-
parent::tearDown();
92-
9389
$this->container = null;
9490
}
9591

src/Symfony/Bundle/WebProfilerBundle/Tests/Profiler/TemplateManagerTest.php

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

3131
protected function setUp(): void
3232
{
33-
parent::setUp();
34-
3533
$this->profiler = $this->createMock(Profiler::class);
3634
$twigEnvironment = $this->mockTwigEnvironment();
3735
$templates = [

src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ abstract class AdapterTestCase extends CachePoolTest
2323
{
2424
protected function setUp(): void
2525
{
26-
parent::setUp();
27-
2826
if (!\array_key_exists('testPrune', $this->skippedTests) && !$this->createCachePool() instanceof PruneableInterface) {
2927
$this->skippedTests['testPrune'] = 'Not a pruneable cache pool.';
3028
}

src/Symfony/Component/Cache/Tests/Psr16CacheProxyTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ class Psr16CacheProxyTest extends SimpleCacheTest
2121
{
2222
protected function setUp(): void
2323
{
24-
parent::setUp();
25-
2624
try {
2725
\assert(false === true, new \Exception());
2826
$this->skippedTests['testGetInvalidKeys'] =

src/Symfony/Component/Cache/Tests/Psr16CacheTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ class Psr16CacheTest extends SimpleCacheTest
2424
{
2525
protected function setUp(): void
2626
{
27-
parent::setUp();
28-
2927
if (\array_key_exists('testPrune', $this->skippedTests)) {
3028
return;
3129
}

src/Symfony/Component/Cache/Tests/Psr16CacheWithExternalAdapter.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ class Psr16CacheWithExternalAdapter extends SimpleCacheTest
2323
{
2424
protected function setUp(): void
2525
{
26-
parent::setUp();
27-
2826
$this->skippedTests['testSetTtl&# 10000 39;] =
2927
$this->skippedTests['testSetMultipleTtl'] = 'The ExternalAdapter test class does not support TTLs.';
3028
}

src/Symfony/Component/Config/Tests/Builder/GeneratedConfigTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,13 @@ class GeneratedConfigTest extends TestCase
4040

4141
protected function setup(): void
4242
{
43-
parent::setup();
44-
4543
$this->tempDir = [];
4644
}
4745

4846
protected function tearDown(): void
4947
{
5048
(new Filesystem())->remove($this->tempDir);
5149
$this->tempDir = [];
52-
53-
parent::tearDown();
5450
}
5551

5652
public static function fixtureNames()

src/Symfony/Component/Console/Tests/Question/QuestionTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ class QuestionTest extends TestCase
2020

2121
protected function setUp(): void
2222
{
23-
parent::setUp();
2423
$this->question = new Question('Test question');
2524
}
2625

src/Symfony/Component/Form/Tests/ChoiceList/AbstractChoiceListTestCase.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ abstract class AbstractChoiceListTestCase extends TestCase
3939

4040
protected function setUp(): void
4141
{
42-
parent::setUp();
43-
4442
$this->list = $this->createChoiceList();
4543

4644
$choices = $this->getChoices();

src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformerTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ class DateTimeToLocalizedStringTransformerTest extends BaseDateTimeTransformerTe
3131

3232
protected function setUp(): void
3333
{
34-
parent::setUp();
35-
3634
// Normalize intl. configuration settings.
3735
if (\extension_loaded('intl')) {
3836
$this->initialTestCaseUseException = ini_set('intl.use_exceptions', 0);

src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToRfc3339TransformerTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ class DateTimeToRfc3339TransformerTest extends BaseDateTimeTransformerTestCase
2525

2626
protected function setUp(): void
2727
{
28-
parent::setUp();
29-
3028
$this->dateTime = new \DateTime('2010-02-03 04:05:06 UTC');
3129
$this->dateTimeWithoutSeconds = new \DateTime('2010-02-03 04:05:00 UTC');
3230
}

src/Symfony/Component/Form/Tests/Extension/Core/Type/MoneyTypeTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ protected function setUp(): void
3333

3434
protected function tearDown(): void
3535
{
36-
parent::tearDown();
37-
3836
\Locale::setDefault($this->defaultLocale);
3937
}
4038

src/Symfony/Component/Form/Tests/Extension/Core/Type/NumberTypeTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ protected function setUp(): void
3535

3636
protected function tearDown(): void
3737
{
38-
parent::tearDown();
39-
4038
\Locale::setDefault($this->defaultLocale);
4139
}
4240

src/Symfony/Component/Form/Tests/Extension/Core/Type/PercentTypeTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ protected function setUp(): void
3434

3535
protected function tearDown(): void
3636
{
37-
parent::tearDown();
38-
3937
\Locale::setDefault($this->defaultLocale);
4038
}
4139

src/Symfony/Component/Form/Tests/NativeRequestHandlerTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ protected function setUp(): void
4141

4242
protected function tearDown(): void
4343
{
44-
parent::tearDown();
45-
4644
$_GET = [];
4745
$_POST = [];
4846
$_FILES = [];

src/Symfony/Component/HttpFoundation/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()

src/Symfony/Component/HttpFoundation/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()

src/Symfony/Component/HttpFoundation/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
}

src/Symfony/Component/HttpFoundation/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
}

src/Symfony/Component/HttpFoundation/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 {

src/Symfony/Component/HttpFoundation/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()

src/Symfony/Component/HttpFoundation/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);

src/Symfony/Component/Intl/Tests/IntlTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,11 @@ class IntlTest extends TestCase
2020

2121
protected function setUp(): void
2222
{
23-
parent::setUp();
24-
2523
$this->defaultLocale = \Locale::getDefault();
2624
}
2725

2826
protected function tearDown(): void
2927
{
30-
parent::tearDown();
31-
3228
\Locale::setDefault($this->defaultLocale);
3329
}
3430

src/Symfony/Component/Mailer/Tests/Transport/NativeTransportFactoryTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ final class NativeTransportFactoryTest extends TestCase
2626

2727
public static function setUpBeforeClass(): void
2828
{
29-
parent::setUpBeforeClass();
30-
3129
$namespace = str_replace('\\Tests\\', '\\', __NAMESPACE__);
3230

3331
$current = static::class;

src/Symfony/Component/Messenger/Bridge/Amqp/Tests/Transport/AmqpExtIntegrationTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ class AmqpExtIntegrationTest extends TestCase
4040
{
4141
protected function setUp(): void
4242
{
43-
parent::setUp();
44-
4543
if (!getenv('MESSENGER_AMQP_DSN')) {
4644
$this->markTestSkipped('The "MESSENGER_AMQP_DSN" environment variable is required.');
4745
}

src/Symfony/Component/Routing/Tests/Generator/Dumper/CompiledUrlGeneratorDumperTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ class CompiledUrlGeneratorDumperTest extends TestCase
3333

3434
protected function setUp(): void
3535
{
36-
parent::setUp();
37-
3836
$this->routeCollection = new RouteCollection();
3937
$this->generatorDumper = new CompiledUrlGeneratorDumper($this->routeCollection);
4038
$this->testTmpFilepath = sys_get_temp_dir().'/php_generator.'.$this->getName().'.php';
@@ -45,8 +43,6 @@ protected function setUp(): void
4543

4644
protected function tearDown(): void
4745
{
48-
parent::tearDown();
49-
5046
@unlink($this->testTmpFilepath);
5147
@unlink($this->largeTestTmpFilepath);
5248
}

src/Symfony/Component/Routing/Tests/Loader/AttributeClassLoaderTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ class AttributeClassLoaderTest extends TestCase
5050

5151
protected function setUp(?string $env = null): void
5252
{
53-
parent::setUp();
54-
5553
$this->loader = new TraceableAttributeClassLoader($env);
5654
}
5755

src/Symfony/Component/Routing/Tests/Loader/AttributeDirectoryLoaderTest.php

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

2828
protected function setUp(): void
2929
{
30-
parent::setUp();
31-
3230
$this->classLoader = new TraceableAttributeClassLoader();
3331
$this->loader = new AttributeDirectoryLoader(new FileLocator(), $this->classLoader);
3432
}

src/Symfony/Component/Routing/Tests/Loader/AttributeFileLoaderTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ class AttributeFileLoaderTest extends TestCase
3333

3434
protected function setUp(): void
3535
{
36-
parent::setUp();
37-
3836
$this->classLoader = new TraceableAttributeClassLoader();
3937
$this->loader = new AttributeFileLoader(new FileLocator(), $this->classLoader);
4038
}

src/Symfony/Component/Routing/Tests/Loader/DirectoryLoaderTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ class DirectoryLoaderTest extends TestCase
2626

2727
protected function setUp(): void
2828
{
29-
parent::setUp();
30-
3129
$locator = new FileLocator();
3230
$this->loader = new DirectoryLoader($locator);
3331
$resolver = new LoaderResolver([

src/Symfony/Component/Routing/Tests/Matcher/Dumper/CompiledUrlMatcherDumperTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,11 @@ class CompiledUrlMatcherDumperTest extends TestCase
2828

2929
protected function setUp(): void
3030
{
31-
parent::setUp();
32-
3331
$this->dumpPath = tempnam(sys_get_temp_dir(), 'sf_matcher_');
3432
}
3533

3634
protected function tearDown(): void
3735
{
38-
parent::tearDown();
39-
4036
@unlink($this->dumpPath);
4137
}
4238

src/Symfony/Component/Security/Csrf/Tests/CsrfTokenManagerTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,6 @@ protected function setUp(): void
546546

547547
protected function tearDown(): void
548548
{
549-
parent::tearDown();
550-
551549
unset($_SERVER['HTTPS']);
552550
}
553551
}

src/Symfony/Component/Translation/Tests/Command/TranslationProviderTestCase.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ abstract class TranslationProviderTestCase extends TestCase
2929

3030
protected function setUp(): void
3131
{
32-
parent::setUp();
3332
$this->defaultLocale = \Locale::getDefault();
3433
\Locale::setDefault('en');
3534
$this->fs = new Filesystem();
@@ -42,7 +41,6 @@ protected function tearDown(): void
4241
{
4342
\Locale::setDefault($this->defaultLocale);
4443
$this->fs->remove($this->translationAppDir);
45-
parent::tearDown();
4644
}
4745

4846
protected function getProviderCollection(ProviderInterface $provider, array $providerNames = ['loco'], array $locales = ['en'], array $domains = ['messages']): TranslationProviderCollection

0 commit comments

Comments
 (0)
0