From 97bcb5da50823747b3a44875b62b165c5cb29a55 Mon Sep 17 00:00:00 2001 From: Luis Pabon Date: Thu, 1 Aug 2019 11:16:35 +0100 Subject: [PATCH] Ensure signatures for setUp|tearDown|setUpAfterClass|tearDownAfterClass methods in tests are compatible with phpunit 8.2 --- .../Tests/Messenger/DoctrineCloseConnectionMiddlewareTest.php | 2 +- .../Tests/Messenger/DoctrinePingConnectionMiddlewareTest.php | 2 +- .../Tests/Messenger/DoctrineTransactionMiddlewareTest.php | 2 +- src/Symfony/Bridge/PhpUnit/Tests/ClassExistsMockTest.php | 4 ++-- .../Tests/Command/CachePoolDeleteCommandTest.php | 2 +- .../FrameworkBundle/Tests/Command/XliffLintCommandTest.php | 4 ++-- .../Tests/Functional/CachePoolListCommandTest.php | 2 +- .../Tests/Functional/RouterDebugCommandTest.php | 2 +- .../Tests/Functional/TranslationDebugCommandTest.php | 2 +- .../Cache/Tests/Adapter/PredisTagAwareAdapterTest.php | 2 +- .../Cache/Tests/Adapter/PredisTagAwareClusterAdapterTest.php | 2 +- .../Tests/Adapter/PredisTagAwareRedisClusterAdapterTest.php | 2 +- .../Cache/Tests/Adapter/RedisTagAwareAdapterTest.php | 2 +- .../Cache/Tests/Adapter/RedisTagAwareArrayAdapterTest.php | 2 +- .../Cache/Tests/Adapter/RedisTagAwareClusterAdapterTest.php | 2 +- .../Cache/Tests/DependencyInjection/CachePoolPassTest.php | 2 +- src/Symfony/Component/Cache/Tests/Psr16CacheTest.php | 2 +- .../Console/Tests/Helper/DumperNativeFallbackTest.php | 4 ++-- src/Symfony/Component/Console/Tests/Helper/DumperTest.php | 4 ++-- .../Console/Tests/Output/ConsoleSectionOutputTest.php | 4 ++-- src/Symfony/Component/Console/Tests/Question/QuestionTest.php | 2 +- .../Tests/ParameterBag/ContainerBagTest.php | 2 +- .../Component/EventDispatcher/Tests/EventDispatcherTest.php | 4 ++-- .../Tests/ChoiceList/Loader/IntlCallbackChoiceLoaderTest.php | 4 ++-- .../Core/DataTransformer/StringToFloatTransformerTest.php | 4 ++-- src/Symfony/Component/HttpClient/Tests/Psr18ClientTest.php | 2 +- .../Session/Storage/Handler/MigratingSessionHandlerTest.php | 2 +- .../Storage/Handler/RedisClusterSessionHandlerTest.php | 2 +- .../Tests/EventListener/LocaleAwareListenerTest.php | 2 +- src/Symfony/Component/Lock/Tests/Store/PdoDbalStoreTest.php | 4 ++-- src/Symfony/Component/Lock/Tests/Store/PdoStoreTest.php | 4 ++-- .../Component/Messenger/Tests/Command/DebugCommandTest.php | 4 ++-- .../Tests/DataCollector/MessengerDataCollectorTest.php | 2 +- .../Tests/Transport/AmqpExt/AmqpExtIntegrationTest.php | 2 +- .../Tests/Transport/InMemoryTransportFactoryTest.php | 2 +- .../Messenger/Tests/Transport/InMemoryTransportTest.php | 2 +- .../Tests/Transport/RedisExt/RedisExtIntegrationTest.php | 2 +- .../Component/Mime/Tests/AbstractMimeTypeGuesserTest.php | 2 +- .../Tests/Generator/Dumper/CompiledUrlGeneratorDumperTest.php | 4 ++-- .../Tests/Matcher/Dumper/CompiledUrlMatcherDumperTest.php | 4 ++-- .../Security/Core/Tests/Encoder/SodiumPasswordEncoderTest.php | 2 +- .../Normalizer/ConstraintViolationListNormalizerTest.php | 2 +- .../Tests/Normalizer/DateTimeZoneNormalizerTest.php | 2 +- .../Translation/Tests/Command/XliffLintCommandTest.php | 4 ++-- .../VarDumper/Tests/Command/Descriptor/CliDescriptorTest.php | 4 ++-- .../VarDumper/Tests/Command/Descriptor/HtmlDescriptorTest.php | 4 ++-- .../Workflow/Tests/Metadata/InMemoryMetadataStoreTest.php | 2 +- src/Symfony/Component/Yaml/Tests/ParserTest.php | 4 ++-- 48 files changed, 65 insertions(+), 65 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/Tests/Messenger/DoctrineCloseConnectionMiddlewareTest.php b/src/Symfony/Bridge/Doctrine/Tests/Messenger/DoctrineCloseConnectionMiddlewareTest.php index df5414e3cc23..94cab6314e25 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Messenger/DoctrineCloseConnectionMiddlewareTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Messenger/DoctrineCloseConnectionMiddlewareTest.php @@ -27,7 +27,7 @@ class DoctrineCloseConnectionMiddlewareTest extends MiddlewareTestCase private $middleware; private $entityManagerName = 'default'; - protected function setUp() + protected function setUp(): void { $this->connection = $this->createMock(Connection::class); diff --git a/src/Symfony/Bridge/Doctrine/Tests/Messenger/DoctrinePingConnectionMiddlewareTest.php b/src/Symfony/Bridge/Doctrine/Tests/Messenger/DoctrinePingConnectionMiddlewareTest.php index ae71d0d16874..f3aa27f31434 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Messenger/DoctrinePingConnectionMiddlewareTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Messenger/DoctrinePingConnectionMiddlewareTest.php @@ -27,7 +27,7 @@ class DoctrinePingConnectionMiddlewareTest extends MiddlewareTestCase private $middleware; private $entityManagerName = 'default'; - protected function setUp() + protected function setUp(): void { $this->connection = $this->createMock(Connection::class); diff --git a/src/Symfony/Bridge/Doctrine/Tests/Messenger/DoctrineTransactionMiddlewareTest.php b/src/Symfony/Bridge/Doctrine/Tests/Messenger/DoctrineTransactionMiddlewareTest.php index 04fb86140ee3..bb777863397f 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Messenger/DoctrineTransactionMiddlewareTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Messenger/DoctrineTransactionMiddlewareTest.php @@ -25,7 +25,7 @@ class DoctrineTransactionMiddlewareTest extends MiddlewareTestCase private $entityManager; private $middleware; - public function setUp() + public function setUp(): void { $this->connection = $this->createMock(Connection::class); diff --git a/src/Symfony/Bridge/PhpUnit/Tests/ClassExistsMockTest.php b/src/Symfony/Bridge/PhpUnit/Tests/ClassExistsMockTest.php index 002d313a6fa0..3e3d5771b1b1 100644 --- a/src/Symfony/Bridge/PhpUnit/Tests/ClassExistsMockTest.php +++ b/src/Symfony/Bridge/PhpUnit/Tests/ClassExistsMockTest.php @@ -16,12 +16,12 @@ class ClassExistsMockTest extends TestCase { - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { ClassExistsMock::register(__CLASS__); } - protected function setUp() + protected function setUp(): void { ClassExistsMock::withMockedClasses([ ExistingClass::class => false, diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CachePoolDeleteCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CachePoolDeleteCommandTest.php index e22d8542072a..143364eacd62 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CachePoolDeleteCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CachePoolDeleteCommandTest.php @@ -23,7 +23,7 @@ class CachePoolDeleteCommandTest extends TestCase { private $cachePool; - protected function setUp() + protected function setUp(): void { $this->cachePool = $this->getMockBuilder(CacheItemPoolInterface::class) ->getMock(); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/XliffLintCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/XliffLintCommandTest.php index 1729351a7d59..542272da5568 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/XliffLintCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/XliffLintCommandTest.php @@ -131,13 +131,13 @@ private function getKernelAwareApplicationMock() return $application; } - protected function setUp() + protected function setUp(): void { @mkdir(sys_get_temp_dir().'/xliff-lint-test'); $this->files = []; } - protected function tearDown() + protected function tearDown(): void { foreach ($this->files as $file) { if (file_exists($file)) { diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/CachePoolListCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/CachePoolListCommandTest.php index e9b8ed5e34ee..a76234697e5a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/CachePoolListCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/CachePoolListCommandTest.php @@ -20,7 +20,7 @@ */ class CachePoolListCommandTest extends AbstractWebTestCase { - protected function setUp() + protected function setUp(): void { static::bootKernel(['test_case' => 'CachePools', 'root_config' => 'config.yml']); } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/RouterDebugCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/RouterDebugCommandTest.php index a13a4e9fc99a..c7c7ac9ace77 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/RouterDebugCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/RouterDebugCommandTest.php @@ -21,7 +21,7 @@ class RouterDebugCommandTest extends AbstractWebTestCase { private $application; - protected function setUp() + protected function setUp(): void { $kernel = static::createKernel(['test_case' => 'RouterDebug', 'root_config' => 'config.yml']); $this->application = new Application($kernel); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/TranslationDebugCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/TranslationDebugCommandTest.php index de4c293c0928..8ce0ce06091d 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/TranslationDebugCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/TranslationDebugCommandTest.php @@ -21,7 +21,7 @@ class TranslationDebugCommandTest extends AbstractWebTestCase { private $application; - protected function setUp() + protected function setUp(): void { $kernel = static::createKernel(['test_case' => 'TransDebug', 'root_config' => 'config.yml']); $this->application = new Application($kernel); diff --git a/src/Symfony/Component/Cache/Tests/Adapter/PredisTagAwareAdapterTest.php b/src/Symfony/Component/Cache/Tests/Adapter/PredisTagAwareAdapterTest.php index e321a1c9b8c2..e685d7608388 100644 --- a/src/Symfony/Component/Cache/Tests/Adapter/PredisTagAwareAdapterTest.php +++ b/src/Symfony/Component/Cache/Tests/Adapter/PredisTagAwareAdapterTest.php @@ -18,7 +18,7 @@ class PredisTagAwareAdapterTest extends PredisAdapterTest { use TagAwareTestTrait; - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->skippedTests['testTagItemExpiry'] = 'Testing expiration slows down the test suite'; diff --git a/src/Symfony/Component/Cache/Tests/Adapter/PredisTagAwareClusterAdapterTest.php b/src/Symfony/Component/Cache/Tests/Adapter/PredisTagAwareClusterAdapterTest.php index a8a72e1de4ea..8c604c1ca6bf 100644 --- a/src/Symfony/Component/Cache/Tests/Adapter/PredisTagAwareClusterAdapterTest.php +++ b/src/Symfony/Component/Cache/Tests/Adapter/PredisTagAwareClusterAdapterTest.php @@ -18,7 +18,7 @@ class PredisTagAwareClusterAdapterTest extends PredisClusterAdapterTest { use TagAwareTestTrait; - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->skippedTests['testTagItemExpiry'] = 'Testing expiration slows down the test suite'; diff --git a/src/Symfony/Component/Cache/Tests/Adapter/PredisTagAwareRedisClusterAdapterTest.php b/src/Symfony/Component/Cache/Tests/Adapter/PredisTagAwareRedisClusterAdapterTest.php index 5b82a80ecb32..e8d2ea654f31 100644 --- a/src/Symfony/Component/Cache/Tests/Adapter/PredisTagAwareRedisClusterAdapterTest.php +++ b/src/Symfony/Component/Cache/Tests/Adapter/PredisTagAwareRedisClusterAdapterTest.php @@ -18,7 +18,7 @@ class PredisTagAwareRedisClusterAdapterTest extends PredisRedisClusterAdapterTes { use TagAwareTestTrait; - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->skippedTests['testTagItemExpiry'] = 'Testing expiration slows down the test suite'; diff --git a/src/Symfony/Component/Cache/Tests/Adapter/RedisTagAwareAdapterTest.php b/src/Symfony/Component/Cache/Tests/Adapter/RedisTagAwareAdapterTest.php index 95e5fe7e3a9e..ef140818575d 100644 --- a/src/Symfony/Component/Cache/Tests/Adapter/RedisTagAwareAdapterTest.php +++ b/src/Symfony/Component/Cache/Tests/Adapter/RedisTagAwareAdapterTest.php @@ -19,7 +19,7 @@ class RedisTagAwareAdapterTest extends RedisAdapterTest { use TagAwareTestTrait; - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->skippedTests['testTagItemExpiry'] = 'Testing expiration slows down the test suite'; diff --git a/src/Symfony/Component/Cache/Tests/Adapter/RedisTagAwareArrayAdapterTest.php b/src/Symfony/Component/Cache/Tests/Adapter/RedisTagAwareArrayAdapterTest.php index 5855cc3adfc6..7c9802040864 100644 --- a/src/Symfony/Component/Cache/Tests/Adapter/RedisTagAwareArrayAdapterTest.php +++ b/src/Symfony/Component/Cache/Tests/Adapter/RedisTagAwareArrayAdapterTest.php @@ -18,7 +18,7 @@ class RedisTagAwareArrayAdapterTest extends RedisArrayAdapterTest { use TagAwareTestTrait; - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->skippedTests['testTagItemExpiry'] = 'Testing expiration slows down the test suite'; diff --git a/src/Symfony/Component/Cache/Tests/Adapter/RedisTagAwareClusterAdapterTest.php b/src/Symfony/Component/Cache/Tests/Adapter/RedisTagAwareClusterAdapterTest.php index ef17c1d69e81..7b7d6801940f 100644 --- a/src/Symfony/Component/Cache/Tests/Adapter/RedisTagAwareClusterAdapterTest.php +++ b/src/Symfony/Component/Cache/Tests/Adapter/RedisTagAwareClusterAdapterTest.php @@ -19,7 +19,7 @@ class RedisTagAwareClusterAdapterTest extends RedisClusterAdapterTest { use TagAwareTestTrait; - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->skippedTests['testTagItemExpiry'] = 'Testing expiration slows down the test suite'; diff --git a/src/Symfony/Component/Cache/Tests/DependencyInjection/CachePoolPassTest.php b/src/Symfony/Component/Cache/Tests/DependencyInjection/CachePoolPassTest.php index 4681b3dc8197..7a175c17e9da 100644 --- a/src/Symfony/Component/Cache/Tests/DependencyInjection/CachePoolPassTest.php +++ b/src/Symfony/Component/Cache/Tests/DependencyInjection/CachePoolPassTest.php @@ -24,7 +24,7 @@ class CachePoolPassTest extends TestCase { private $cachePoolPass; - protected function setUp() + protected function setUp(): void { $this->cachePoolPass = new CachePoolPass(); } diff --git a/src/Symfony/Component/Cache/Tests/Psr16CacheTest.php b/src/Symfony/Component/Cache/Tests/Psr16CacheTest.php index e56d99e44134..7774e1ddd588 100644 --- a/src/Symfony/Component/Cache/Tests/Psr16CacheTest.php +++ b/src/Symfony/Component/Cache/Tests/Psr16CacheTest.php @@ -21,7 +21,7 @@ */ class Psr16CacheTest extends SimpleCacheTest { - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/src/Symfony/Component/Console/Tests/Helper/DumperNativeFallbackTest.php b/src/Symfony/Component/Console/Tests/Helper/DumperNativeFallbackTest.php index b9fa2dc2947e..b0d13cc1b75e 100644 --- a/src/Symfony/Component/Console/Tests/Helper/DumperNativeFallbackTest.php +++ b/src/Symfony/Component/Console/Tests/Helper/DumperNativeFallbackTest.php @@ -19,7 +19,7 @@ class DumperNativeFallbackTest extends TestCase { - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { ClassExistsMock::register(Dumper::class); ClassExistsMock::withMockedClasses([ @@ -27,7 +27,7 @@ public static function setUpBeforeClass() ]); } - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { ClassExistsMock::withMockedClasses([]); } diff --git a/src/Symfony/Component/Console/Tests/Helper/DumperTest.php b/src/Symfony/Component/Console/Tests/Helper/DumperTest.php index 00c480a6a901..7974527d3615 100644 --- a/src/Symfony/Component/Console/Tests/Helper/DumperTest.php +++ b/src/Symfony/Component/Console/Tests/Helper/DumperTest.php @@ -20,13 +20,13 @@ class DumperTest extends TestCase { use VarDumperTestTrait; - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { putenv('DUMP_LIGHT_ARRAY=1'); putenv('DUMP_COMMA_SEPARATOR=1'); } - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { putenv('DUMP_LIGHT_ARRAY'); putenv('DUMP_COMMA_SEPARATOR'); diff --git a/src/Symfony/Component/Console/Tests/Output/ConsoleSectionOutputTest.php b/src/Symfony/Component/Console/Tests/Output/ConsoleSectionOutputTest.php index 4c292c2c695e..e8d9a8b49253 100644 --- a/src/Symfony/Component/Console/Tests/Output/ConsoleSectionOutputTest.php +++ b/src/Symfony/Component/Console/Tests/Output/ConsoleSectionOutputTest.php @@ -24,12 +24,12 @@ class ConsoleSectionOutputTest extends TestCase { private $stream; - protected function setUp() + protected function setUp(): void { $this->stream = fopen('php://memory', 'r+b', false); } - protected function tearDown() + protected function tearDown(): void { $this->stream = null; } diff --git a/src/Symfony/Component/Console/Tests/Question/QuestionTest.php b/src/Symfony/Component/Console/Tests/Question/QuestionTest.php index 13c8e362e145..59b714291a8e 100644 --- a/src/Symfony/Component/Console/Tests/Question/QuestionTest.php +++ b/src/Symfony/Component/Console/Tests/Question/QuestionTest.php @@ -19,7 +19,7 @@ class QuestionTest extends TestCase { private $question; - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->question = new Question('Test question'); diff --git a/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/ContainerBagTest.php b/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/ContainerBagTest.php index 24ed685e49cc..c807b2c98959 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/ContainerBagTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/ContainerBagTest.php @@ -26,7 +26,7 @@ class ContainerBagTest extends TestCase /** @var ContainerBag */ private $containerBag; - protected function setUp() + protected function setUp(): void { $this->parameterBag = new ParameterBag(['foo' => 'value']); $this->containerBag = new ContainerBag(new Container($this->parameterBag)); diff --git a/src/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php b/src/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php index 658a94123933..9b9253b479f9 100644 --- a/src/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php +++ b/src/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php @@ -32,13 +32,13 @@ class EventDispatcherTest extends TestCase private $listener; - protected function setUp() + protected function setUp(): void { $this->dispatcher = $this->createEventDispatcher(); $this->listener = new TestEventListener(); } - protected function tearDown() + protected function tearDown(): void { $this->dispatcher = null; $this->listener = null; diff --git a/src/Symfony/Component/Form/Tests/ChoiceList/Loader/IntlCallbackChoiceLoaderTest.php b/src/Symfony/Component/Form/Tests/ChoiceList/Loader/IntlCallbackChoiceLoaderTest.php index 7571517283f9..a5fc262dcd3a 100644 --- a/src/Symfony/Component/Form/Tests/ChoiceList/Loader/IntlCallbackChoiceLoaderTest.php +++ b/src/Symfony/Component/Form/Tests/ChoiceList/Loader/IntlCallbackChoiceLoaderTest.php @@ -47,7 +47,7 @@ class IntlCallbackChoiceLoaderTest extends TestCase */ private static $lazyChoiceList; - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { self::$loader = new IntlCallbackChoiceLoader(function () { return self::$choices; @@ -98,7 +98,7 @@ public function testLoadValuesForChoicesLoadsChoiceListOnFirstCall() ); } - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { self::$loader = null; self::$value = null; diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/StringToFloatTransformerTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/StringToFloatTransformerTest.php index 5726a217da3d..2eae3121b6f3 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/StringToFloatTransformerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/StringToFloatTransformerTest.php @@ -18,12 +18,12 @@ class StringToFloatTransformerTest extends TestCase { private $transformer; - protected function setUp() + protected function setUp(): void { $this->transformer = new StringToFloatTransformer(); } - protected function tearDown() + protected function tearDown(): void { $this->transformer = null; } diff --git a/src/Symfony/Component/HttpClient/Tests/Psr18ClientTest.php b/src/Symfony/Component/HttpClient/Tests/Psr18ClientTest.php index 87b2a7ce0bd1..42e627b590e1 100644 --- a/src/Symfony/Component/HttpClient/Tests/Psr18ClientTest.php +++ b/src/Symfony/Component/HttpClient/Tests/Psr18ClientTest.php @@ -23,7 +23,7 @@ class Psr18ClientTest extends TestCase { private static $server; - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { TestHttpServer::start(); } diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MigratingSessionHandlerTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MigratingSessionHandlerTest.php index 6dc5b0cb5c48..01615e6b1f2e 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MigratingSessionHandlerTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MigratingSessionHandlerTest.php @@ -20,7 +20,7 @@ class MigratingSessionHandlerTest extends TestCase private $currentHandler; private $writeOnlyHandler; - protected function setUp() + protected function setUp(): void { $this->currentHandler = $this->createMock(\SessionHandlerInterface::class); $this->writeOnlyHandler = $this->createMock(\SessionHandlerInterface::class); diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/RedisClusterSessionHandlerTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/RedisClusterSessionHandlerTest.php index 7d85a59ee773..c1ba70dcb08c 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/RedisClusterSessionHandlerTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/RedisClusterSessionHandlerTest.php @@ -13,7 +13,7 @@ class RedisClusterSessionHandlerTest extends AbstractRedisSessionHandlerTestCase { - public static function setupBeforeClass() + public static function setUpBeforeClass(): void { if (!class_exists('RedisCluster')) { self::markTestSkipped('The RedisCluster class is required.'); diff --git a/src/Symfony/Component/HttpKernel/Tests/EventListener/LocaleAwareListenerTest.php b/src/Symfony/Component/HttpKernel/Tests/EventListener/LocaleAwareListenerTest.php index 489b02151c9d..ef3b7d1b4299 100644 --- a/src/Symfony/Component/HttpKernel/Tests/EventListener/LocaleAwareListenerTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/EventListener/LocaleAwareListenerTest.php @@ -26,7 +26,7 @@ class LocaleAwareListenerTest extends TestCase private $localeAwareService; private $requestStack; - protected function setUp() + protected function setUp(): void { $this->localeAwareService = $this->getMockBuilder(LocaleAwareInterface::class)->getMock(); $this->requestStack = new RequestStack(); diff --git a/src/Symfony/Component/Lock/Tests/Store/PdoDbalStoreTest.php b/src/Symfony/Component/Lock/Tests/Store/PdoDbalStoreTest.php index 0dd32c08473e..2a8ec082a113 100644 --- a/src/Symfony/Component/Lock/Tests/Store/PdoDbalStoreTest.php +++ b/src/Symfony/Component/Lock/Tests/Store/PdoDbalStoreTest.php @@ -25,7 +25,7 @@ class PdoDbalStoreTest extends AbstractStoreTest protected static $dbFile; - public static function setupBeforeClass() + public static function setUpBeforeClass(): void { self::$dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_lock'); @@ -33,7 +33,7 @@ public static function setupBeforeClass() $store->createTable(); } - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { @unlink(self::$dbFile); } diff --git a/src/Symfony/Component/Lock/Tests/Store/PdoStoreTest.php b/src/Symfony/Component/Lock/Tests/Store/PdoStoreTest.php index 45e3544e2bf8..40797ae7cb24 100644 --- a/src/Symfony/Component/Lock/Tests/Store/PdoStoreTest.php +++ b/src/Symfony/Component/Lock/Tests/Store/PdoStoreTest.php @@ -24,7 +24,7 @@ class PdoStoreTest extends AbstractStoreTest protected static $dbFile; - public static function setupBeforeClass() + public static function setUpBeforeClass(): void { self::$dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_lock'); @@ -32,7 +32,7 @@ public static function setupBeforeClass() $store->createTable(); } - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { @unlink(self::$dbFile); } diff --git a/src/Symfony/Component/Messenger/Tests/Command/DebugCommandTest.php b/src/Symfony/Component/Messenger/Tests/Command/DebugCommandTest.php index ed867aa9757e..e78b88d0fcc2 100644 --- a/src/Symfony/Component/Messenger/Tests/Command/DebugCommandTest.php +++ b/src/Symfony/Component/Messenger/Tests/Command/DebugCommandTest.php @@ -26,12 +26,12 @@ */ class DebugCommandTest extends TestCase { - protected function setUp() + protected function setUp(): void { putenv('COLUMNS='.(119 + \strlen(PHP_EOL))); } - protected function tearDown() + protected function tearDown(): void { putenv('COLUMNS='); } diff --git a/src/Symfony/Component/Messenger/Tests/DataCollector/MessengerDataCollectorTest.php b/src/Symfony/Component/Messenger/Tests/DataCollector/MessengerDataCollectorTest.php index abe1b3453ff2..cebcd7834874 100644 --- a/src/Symfony/Component/Messenger/Tests/DataCollector/MessengerDataCollectorTest.php +++ b/src/Symfony/Component/Messenger/Tests/DataCollector/MessengerDataCollectorTest.php @@ -28,7 +28,7 @@ class MessengerDataCollectorTest extends TestCase /** @var CliDumper */ private $dumper; - protected function setUp() + protected function setUp(): void { $this->dumper = new CliDumper(); $this->dumper->setColors(false); diff --git a/src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/AmqpExtIntegrationTest.php b/src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/AmqpExtIntegrationTest.php index 956e09dc315c..d62e3014dab9 100644 --- a/src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/AmqpExtIntegrationTest.php +++ b/src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/AmqpExtIntegrationTest.php @@ -36,7 +36,7 @@ */ class AmqpExtIntegrationTest extends TestCase { - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/src/Symfony/Component/Messenger/Tests/Transport/InMemoryTransportFactoryTest.php b/src/Symfony/Component/Messenger/Tests/Transport/InMemoryTransportFactoryTest.php index fd6bebc3b69d..94c2b5580e0d 100644 --- a/src/Symfony/Component/Messenger/Tests/Transport/InMemoryTransportFactoryTest.php +++ b/src/Symfony/Component/Messenger/Tests/Transport/InMemoryTransportFactoryTest.php @@ -28,7 +28,7 @@ class InMemoryTransportFactoryTest extends TestCase */ private $factory; - protected function setUp() + protected function setUp(): void { $this->factory = new InMemoryTransportFactory(); } diff --git a/src/Symfony/Component/Messenger/Tests/Transport/InMemoryTransportTest.php b/src/Symfony/Component/Messenger/Tests/Transport/InMemoryTransportTest.php index 5d9c8b70088b..2d37e624d394 100644 --- a/src/Symfony/Component/Messenger/Tests/Transport/InMemoryTransportTest.php +++ b/src/Symfony/Component/Messenger/Tests/Transport/InMemoryTransportTest.php @@ -25,7 +25,7 @@ class InMemoryTransportTest extends TestCase */ private $transport; - protected function setUp() + protected function setUp(): void { $this->transport = new InMemoryTransport(); } diff --git a/src/Symfony/Component/Messenger/Tests/Transport/RedisExt/RedisExtIntegrationTest.php b/src/Symfony/Component/Messenger/Tests/Transport/RedisExt/RedisExtIntegrationTest.php index 5342250e843f..66ada676edcf 100644 --- a/src/Symfony/Component/Messenger/Tests/Transport/RedisExt/RedisExtIntegrationTest.php +++ b/src/Symfony/Component/Messenger/Tests/Transport/RedisExt/RedisExtIntegrationTest.php @@ -23,7 +23,7 @@ class RedisExtIntegrationTest extends TestCase private $redis; private $connection; - protected function setUp() + protected function setUp(): void { if (!getenv('MESSENGER_REDIS_DSN')) { $this->markTestSkipped('The "MESSENGER_REDIS_DSN" environment variable is required.'); diff --git a/src/Symfony/Component/Mime/Tests/AbstractMimeTypeGuesserTest.php b/src/Symfony/Component/Mime/Tests/AbstractMimeTypeGuesserTest.php index f9f5ec5703b2..3ac9382f84bc 100644 --- a/src/Symfony/Component/Mime/Tests/AbstractMimeTypeGuesserTest.php +++ b/src/Symfony/Component/Mime/Tests/AbstractMimeTypeGuesserTest.php @@ -16,7 +16,7 @@ abstract class AbstractMimeTypeGuesserTest extends TestCase { - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { $path = __DIR__.'/Fixtures/mimetypes/to_delete'; if (file_exists($path)) { diff --git a/src/Symfony/Component/Routing/Tests/Generator/Dumper/CompiledUrlGeneratorDumperTest.php b/src/Symfony/Component/Routing/Tests/Generator/Dumper/CompiledUrlGeneratorDumperTest.php index 127b8b977c84..e6b076302cb6 100644 --- a/src/Symfony/Component/Routing/Tests/Generator/Dumper/CompiledUrlGeneratorDumperTest.php +++ b/src/Symfony/Component/Routing/Tests/Generator/Dumper/CompiledUrlGeneratorDumperTest.php @@ -41,7 +41,7 @@ class CompiledUrlGeneratorDumperTest extends TestCase */ private $largeTestTmpFilepath; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -53,7 +53,7 @@ protected function setUp() @unlink($this->largeTestTmpFilepath); } - protected function tearDown() + protected function tearDown(): void { parent::tearDown(); diff --git a/src/Symfony/Component/Routing/Tests/Matcher/Dumper/CompiledUrlMatcherDumperTest.php b/src/Symfony/Component/Routing/Tests/Matcher/Dumper/CompiledUrlMatcherDumperTest.php index ad9c8376f72c..91f60de936e0 100644 --- a/src/Symfony/Component/Routing/Tests/Matcher/Dumper/CompiledUrlMatcherDumperTest.php +++ b/src/Symfony/Component/Routing/Tests/Matcher/Dumper/CompiledUrlMatcherDumperTest.php @@ -26,14 +26,14 @@ class CompiledUrlMatcherDumperTest extends TestCase */ private $dumpPath; - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->dumpPath = sys_get_temp_dir().\DIRECTORY_SEPARATOR.'php_matcher.'.uniqid('CompiledUrlMatcher').'.php'; } - protected function tearDown() + protected function tearDown(): void { parent::tearDown(); diff --git a/src/Symfony/Component/Security/Core/Tests/Encoder/SodiumPasswordEncoderTest.php b/src/Symfony/Component/Security/Core/Tests/Encoder/SodiumPasswordEncoderTest.php index 84c8b4849e2b..9a0a3f0d0e98 100644 --- a/src/Symfony/Component/Security/Core/Tests/Encoder/SodiumPasswordEncoderTest.php +++ b/src/Symfony/Component/Security/Core/Tests/Encoder/SodiumPasswordEncoderTest.php @@ -16,7 +16,7 @@ class SodiumPasswordEncoderTest extends TestCase { - protected function setUp() + protected function setUp(): void { if (!SodiumPasswordEncoder::isSupported()) { $this->markTestSkipped('Libsodium is not available.'); diff --git a/src/Symfony/Component/Serializer/Tests/Normalizer/ConstraintViolationListNormalizerTest.php b/src/Symfony/Component/Serializer/Tests/Normalizer/ConstraintViolationListNormalizerTest.php index 24fc7cd2be89..de5e94eed191 100644 --- a/src/Symfony/Component/Serializer/Tests/Normalizer/ConstraintViolationListNormalizerTest.php +++ b/src/Symfony/Component/Serializer/Tests/Normalizer/ConstraintViolationListNormalizerTest.php @@ -25,7 +25,7 @@ class ConstraintViolationListNormalizerTest extends TestCase { private $normalizer; - protected function setUp() + protected function setUp(): void { $this->normalizer = new ConstraintViolationListNormalizer(); } diff --git a/src/Symfony/Component/Serializer/Tests/Normalizer/DateTimeZoneNormalizerTest.php b/src/Symfony/Component/Serializer/Tests/Normalizer/DateTimeZoneNormalizerTest.php index 6f2486d3db5f..c2a851ef7825 100644 --- a/src/Symfony/Component/Serializer/Tests/Normalizer/DateTimeZoneNormalizerTest.php +++ b/src/Symfony/Component/Serializer/Tests/Normalizer/DateTimeZoneNormalizerTest.php @@ -24,7 +24,7 @@ class DateTimeZoneNormalizerTest extends TestCase */ private $normalizer; - protected function setUp() + protected function setUp(): void { $this->normalizer = new DateTimeZoneNormalizer(); } diff --git a/src/Symfony/Component/Translation/Tests/Command/XliffLintCommandTest.php b/src/Symfony/Component/Translation/Tests/Command/XliffLintCommandTest.php index df2e2f0951dd..abda2135fc63 100644 --- a/src/Symfony/Component/Translation/Tests/Command/XliffLintCommandTest.php +++ b/src/Symfony/Component/Translation/Tests/Command/XliffLintCommandTest.php @@ -188,13 +188,13 @@ private function createCommandTester($requireStrictFileNames = true, $applicatio return new CommandTester($command); } - protected function setUp() + protected function setUp(): void { $this->files = []; @mkdir(sys_get_temp_dir().'/translation-xliff-lint-test'); } - protected function tearDown() + protected function tearDown(): void { foreach ($this->files as $file) { if (file_exists($file)) { diff --git a/src/Symfony/Component/VarDumper/Tests/Command/Descriptor/CliDescriptorTest.php b/src/Symfony/Component/VarDumper/Tests/Command/Descriptor/CliDescriptorTest.php index fef5dcd12763..ccd8c5076025 100644 --- a/src/Symfony/Component/VarDumper/Tests/Command/Descriptor/CliDescriptorTest.php +++ b/src/Symfony/Component/VarDumper/Tests/Command/Descriptor/CliDescriptorTest.php @@ -23,7 +23,7 @@ class CliDescriptorTest extends TestCase private static $timezone; private static $prevTerminalEmulator; - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { self::$timezone = date_default_timezone_get(); date_default_timezone_set('UTC'); @@ -32,7 +32,7 @@ public static function setUpBeforeClass() putenv('TERMINAL_EMULATOR'); } - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { date_default_timezone_set(self::$timezone); putenv('TERMINAL_EMULATOR'.(self::$prevTerminalEmulator ? '='.self::$prevTerminalEmulator : '')); diff --git a/src/Symfony/Component/VarDumper/Tests/Command/Descriptor/HtmlDescriptorTest.php b/src/Symfony/Component/VarDumper/Tests/Command/Descriptor/HtmlDescriptorTest.php index f1febf7ceccf..426e99d360c3 100644 --- a/src/Symfony/Component/VarDumper/Tests/Command/Descriptor/HtmlDescriptorTest.php +++ b/src/Symfony/Component/VarDumper/Tests/Command/Descriptor/HtmlDescriptorTest.php @@ -21,13 +21,13 @@ class HtmlDescriptorTest extends TestCase { private static $timezone; - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { self::$timezone = date_default_timezone_get(); date_default_timezone_set('UTC'); } - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { date_default_timezone_set(self::$timezone); } diff --git a/src/Symfony/Component/Workflow/Tests/Metadata/InMemoryMetadataStoreTest.php b/src/Symfony/Component/Workflow/Tests/Metadata/InMemoryMetadataStoreTest.php index 0ce8d9d5d8ad..16d2d6f20cdd 100644 --- a/src/Symfony/Component/Workflow/Tests/Metadata/InMemoryMetadataStoreTest.php +++ b/src/Symfony/Component/Workflow/Tests/Metadata/InMemoryMetadataStoreTest.php @@ -14,7 +14,7 @@ class InMemoryMetadataStoreTest extends TestCase private $store; private $transition; - protected function setUp() + protected function setUp(): void { $workflowMetadata = [ 'title' => 'workflow title', diff --git a/src/Symfony/Component/Yaml/Tests/ParserTest.php b/src/Symfony/Component/Yaml/Tests/ParserTest.php index 3a9cb1290fb2..d84144aa638c 100644 --- a/src/Symfony/Component/Yaml/Tests/ParserTest.php +++ b/src/Symfony/Component/Yaml/Tests/ParserTest.php @@ -25,12 +25,12 @@ class ParserTest extends TestCase /** @var Parser */ protected $parser; - protected function setUp() + protected function setUp(): void { $this->parser = new Parser(); } - protected function tearDown() + protected function tearDown(): void { $this->parser = null;