Disable phpunit typehint patch on 4.3 branch

This commit is contained in:
Jérémy Derussé 2019-08-08 11:17:10 +02:00
parent fda49e699a
commit a5af6c4cd7
No known key found for this signature in database
GPG Key ID: 2083FA5758C473D2
346 changed files with 498 additions and 499 deletions

View File

@ -19,7 +19,6 @@ env:
global:
- MIN_PHP=7.1.3
- SYMFONY_PROCESS_PHP_TEST_BINARY=~/.phpenv/shims/php
- SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1
- MESSENGER_AMQP_DSN=amqp://localhost/%2f/messages
- MESSENGER_REDIS_DSN=redis://127.0.0.1:7001/messages

View File

@ -20,7 +20,7 @@ class ContainerAwareEventManagerTest extends TestCase
private $container;
private $evm;
protected function setUp()
protected function setUp(): void
{
$this->container = new Container();
$this->evm = new ContainerAwareEventManager($this->container);

View File

@ -26,7 +26,7 @@ class DoctrineExtensionTest extends TestCase
*/
private $extension;
protected function setUp()
protected function setUp(): void
{
parent::setUp();

View File

@ -73,7 +73,7 @@ class DoctrineChoiceLoaderTest extends TestCase
*/
private $obj3;
protected function setUp()
protected function setUp(): void
{
$this->factory = $this->getMockBuilder('Symfony\Component\Form\ChoiceList\Factory\ChoiceListFactoryInterface')->getMock();
$this->om = $this->getMockBuilder('Doctrine\Common\Persistence\ObjectManager')->getMock();

View File

@ -25,7 +25,7 @@ class CollectionToArrayTransformerTest extends TestCase
*/
private $transformer;
protected function setUp()
protected function setUp(): void
{
$this->transformer = new CollectionToArrayTransformer();
}

View File

@ -28,7 +28,7 @@ class MergeDoctrineCollectionListenerTest extends TestCase
private $factory;
private $form;
protected function setUp()
protected function setUp(): void
{
$this->collection = new ArrayCollection(['test']);
$this->dispatcher = new EventDispatcher();
@ -37,7 +37,7 @@ class MergeDoctrineCollectionListenerTest extends TestCase
->getForm();
}
protected function tearDown()
protected function tearDown(): void
{
$this->collection = null;
$this->dispatcher = null;

View File

@ -50,7 +50,7 @@ class EntityTypePerformanceTest extends FormPerformanceTestCase
];
}
protected function setUp()
protected function setUp(): void
{
$this->em = DoctrineTestHelper::createTestEntityManager();

View File

@ -60,7 +60,7 @@ class EntityTypeTest extends BaseTypeTest
protected static $supportedFeatureSetVersion = 304;
protected function setUp()
protected function setUp(): void
{
$this->em = DoctrineTestHelper::createTestEntityManager();
$this->emRegistry = $this->createRegistryMock('default', $this->em);
@ -90,7 +90,7 @@ class EntityTypeTest extends BaseTypeTest
}
}
protected function tearDown()
protected function tearDown(): void
{
parent::tearDown();

View File

@ -17,7 +17,7 @@ use Symfony\Bridge\ProxyManager\Tests\LazyProxy\Dumper\PhpDumperTest;
class ManagerRegistryTest extends TestCase
{
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
if (!class_exists('PHPUnit_Framework_TestCase')) {
self::markTestSkipped('proxy-manager-bridge is not yet compatible with namespaced phpunit versions.');

View File

@ -58,7 +58,7 @@ class UniqueEntityValidatorTest extends ConstraintValidatorTestCase
protected $repositoryFactory;
protected function setUp()
protected function setUp(): void
{
$this->repositoryFactory = new TestRepositoryFactory();

View File

@ -21,12 +21,12 @@ use Symfony\Bridge\PhpUnit\ClockMock;
*/
class ClockMockTest extends TestCase
{
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
ClockMock::register(__CLASS__);
}
protected function setUp()
protected function setUp(): void
{
ClockMock::withClockMock(1234567890.125);
}

View File

@ -16,7 +16,7 @@ use Symfony\Bridge\PhpUnit\DnsMock;
class DnsMockTest extends TestCase
{
protected function tearDown()
protected function tearDown(): void
{
DnsMock::withMockedHosts(array());
}

View File

@ -30,7 +30,7 @@ class RuntimeInstantiatorTest extends TestCase
/**
* {@inheritdoc}
*/
protected function setUp()
protected function setUp(): void
{
$this->instantiator = new RuntimeInstantiator();
}

View File

@ -32,7 +32,7 @@ class ProxyDumperTest extends TestCase
/**
* {@inheritdoc}
*/
protected function setUp()
protected function setUp(): void
{
$this->dumper = new ProxyDumper();
}

View File

@ -15,7 +15,7 @@ class AppVariableTest extends TestCase
*/
protected $appVariable;
protected function setUp()
protected function setUp(): void
{
$this->appVariable = new AppVariable();
}

View File

@ -93,12 +93,12 @@ class LintCommandTest extends TestCase
return $filename;
}
protected function setUp()
protected function setUp(): void
{
$this->files = [];
}
protected function tearDown()
protected function tearDown(): void
{
foreach ($this->files as $file) {
if (file_exists($file)) {

View File

@ -33,7 +33,7 @@ class FormExtensionBootstrap3HorizontalLayoutTest extends AbstractBootstrap3Hori
*/
private $renderer;
protected function setUp()
protected function setUp(): void
{
parent::setUp();

View File

@ -29,7 +29,7 @@ class FormExtensionBootstrap3LayoutTest extends AbstractBootstrap3LayoutTest
*/
private $renderer;
protected function setUp()
protected function setUp(): void
{
parent::setUp();

View File

@ -35,7 +35,7 @@ class FormExtensionBootstrap4HorizontalLayoutTest extends AbstractBootstrap4Hori
private $renderer;
protected function setUp()
protected function setUp(): void
{
parent::setUp();

View File

@ -33,7 +33,7 @@ class FormExtensionBootstrap4LayoutTest extends AbstractBootstrap4LayoutTest
*/
private $renderer;
protected function setUp()
protected function setUp(): void
{
parent::setUp();

View File

@ -33,7 +33,7 @@ class FormExtensionDivLayoutTest extends AbstractDivLayoutTest
protected static $supportedFeatureSetVersion = 403;
protected function setUp()
protected function setUp(): void
{
parent::setUp();

View File

@ -32,7 +32,7 @@ class FormExtensionTableLayoutTest extends AbstractTableLayoutTest
protected static $supportedFeatureSetVersion = 403;
protected function setUp()
protected function setUp(): void
{
parent::setUp();

View File

@ -32,7 +32,7 @@ class WebLinkExtensionTest extends TestCase
*/
private $extension;
protected function setUp()
protected function setUp(): void
{
$this->request = new Request();

View File

@ -28,7 +28,7 @@ class WorkflowExtensionTest extends TestCase
private $extension;
private $t1;
protected function setUp()
protected function setUp(): void
{
if (!class_exists(Workflow::class)) {
$this->markTestSkipped('The Workflow component is needed to run tests for this extension.');

View File

@ -17,7 +17,7 @@ class AnnotationsCacheWarmerTest extends TestCase
{
private $cacheDir;
protected function setUp()
protected function setUp(): void
{
$this->cacheDir = sys_get_temp_dir().'/'.uniqid();
$fs = new Filesystem();
@ -25,7 +25,7 @@ class AnnotationsCacheWarmerTest extends TestCase
parent::setUp();
}
protected function tearDown()
protected function tearDown(): void
{
$fs = new Filesystem();
$fs->remove($this->cacheDir);

View File

@ -38,7 +38,7 @@ class TemplatePathsCacheWarmerTest extends TestCase
private $tmpDir;
protected function setUp()
protected function setUp(): void
{
$this->templateFinder = $this
->getMockBuilder(TemplateFinderInterface::class)
@ -59,7 +59,7 @@ class TemplatePathsCacheWarmerTest extends TestCase
$this->filesystem->mkdir($this->tmpDir);
}
protected function tearDown()
protected function tearDown(): void
{
$this->filesystem->remove($this->tmpDir);
}

View File

@ -28,14 +28,14 @@ class CacheClearCommandTest extends TestCase
/** @var Filesystem */
private $fs;
protected function setUp()
protected function setUp(): void
{
$this->fs = new Filesystem();
$this->kernel = new TestAppKernel('test', true);
$this->fs->mkdir($this->kernel->getProjectDir());
}
protected function tearDown()
protected function tearDown(): void
{
$this->fs->remove($this->kernel->getProjectDir());
}

View File

@ -127,7 +127,7 @@ class TranslationDebugCommandTest extends TestCase
$tester->execute(['locale' => 'en', 'bundle' => 'dir']);
}
protected function setUp()
protected function setUp(): void
{
$this->fs = new Filesystem();
$this->translationDir = sys_get_temp_dir().'/'.uniqid('sf_translation', true);
@ -135,7 +135,7 @@ class TranslationDebugCommandTest extends TestCase
$this->fs->mkdir($this->translationDir.'/templates');
}
protected function tearDown()
protected function tearDown(): void
{
$this->fs->remove($this->translationDir);
}

View File

@ -105,7 +105,7 @@ class TranslationUpdateCommandTest extends TestCase
$this->assertRegExp('/Translation files were successfully updated./', $tester->getDisplay());
}
protected function setUp()
protected function setUp(): void
{
$this->fs = new Filesystem();
$this->translationDir = sys_get_temp_dir().'/'.uniqid('sf_translation', true);
@ -113,7 +113,7 @@ class TranslationUpdateCommandTest extends TestCase
$this->fs->mkdir($this->translationDir.'/templates');
}
protected function tearDown()
protected function tearDown(): void
{
$this->fs->remove($this->translationDir);
}

View File

@ -181,13 +181,13 @@ EOF;
return $application;
}
protected function setUp()
protected function setUp(): void
{
@mkdir(sys_get_temp_dir().'/yml-lint-test');
$this->files = [];
}
protected function tearDown()
protected function tearDown(): void
{
foreach ($this->files as $file) {
if (file_exists($file)) {

View File

@ -15,12 +15,12 @@ use Symfony\Bundle\FrameworkBundle\Console\Descriptor\TextDescriptor;
class TextDescriptorTest extends AbstractDescriptorTest
{
protected function setUp()
protected function setUp(): void
{
putenv('COLUMNS=121');
}
protected function tearDown()
protected function tearDown(): void
{
putenv('COLUMNS');
}

View File

@ -23,7 +23,7 @@ class ControllerNameParserTest extends TestCase
{
protected $loader;
protected function setUp()
protected function setUp(): void
{
$this->loader = new ClassLoader();
$this->loader->add('TestBundle', __DIR__.'/../Fixtures');
@ -31,7 +31,7 @@ class ControllerNameParserTest extends TestCase
$this->loader->register();
}
protected function tearDown()
protected function tearDown(): void
{
$this->loader->unregister();
$this->loader = null;

View File

@ -26,7 +26,7 @@ class CachePoolPassTest extends TestCase
{
private $cachePoolPass;
protected function setUp()
protected function setUp(): void
{
$this->cachePoolPass = new CachePoolPass();
}

View File

@ -22,7 +22,7 @@ class DataCollectorTranslatorPassTest extends TestCase
private $container;
private $dataCollectorTranslatorPass;
protected function setUp()
protected function setUp(): void
{
$this->container = new ContainerBuilder();
$this->dataCollectorTranslatorPass = new DataCollectorTranslatorPass();

View File

@ -25,7 +25,7 @@ class WorkflowGuardListenerPassTest extends TestCase
private $container;
private $compilerPass;
protected function setUp()
protected function setUp(): void
{
$this->container = new ContainerBuilder();
$this->compilerPass = new WorkflowGuardListenerPass();

View File

@ -22,12 +22,12 @@ abstract class AbstractWebTestCase extends BaseWebTestCase
self::assertEquals('http://localhost'.$location, $response->headers->get('Location'));
}
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
static::deleteTmpDir();
}
public static function tearDownAfterClass()
public static function tearDownAfterClass(): void
{
static::deleteTmpDir();
}

View File

@ -20,7 +20,7 @@ use Symfony\Component\Console\Tester\CommandTester;
*/
class CachePoolClearCommandTest extends AbstractWebTestCase
{
protected function setUp()
protected function setUp(): void
{
static::bootKernel(['test_case' => 'CachePoolClear', 'root_config' => 'config.yml']);
}

View File

@ -23,7 +23,7 @@ class ConfigDebugCommandTest extends AbstractWebTestCase
{
private $application;
protected function setUp()
protected function setUp(): void
{
$kernel = static::createKernel(['test_case' => 'ConfigDump', 'root_config' => 'config.yml']);
$this->application = new Application($kernel);

View File

@ -23,7 +23,7 @@ class ConfigDumpReferenceCommandTest extends AbstractWebTestCase
{
private $application;
protected function setUp()
protected function setUp(): void
{
$kernel = static::createKernel(['test_case' => 'ConfigDump', 'root_config' => 'config.yml']);
$this->application = new Application($kernel);

View File

@ -23,7 +23,7 @@ class GlobalVariablesTest extends TestCase
private $container;
private $globals;
protected function setUp()
protected function setUp(): void
{
$this->container = new Container();
$this->globals = new GlobalVariables($this->container);

View File

@ -24,7 +24,7 @@ class AssetsHelperTest extends TestCase
{
private $helper;
protected function setUp()
protected function setUp(): void
{
$fooPackage = new Package(new StaticVersionStrategy('42', '%s?v=%s'));
$barPackage = new Package(new StaticVersionStrategy('22', '%s?%s'));

View File

@ -55,7 +55,7 @@ class FormHelperDivLayoutTest extends AbstractDivLayoutTest
]);
}
protected function tearDown()
protected function tearDown(): void
{
$this->engine = null;

View File

@ -100,7 +100,7 @@ class FormHelperTableLayoutTest extends AbstractTableLayoutTest
]);
}
protected function tearDown()
protected function tearDown(): void
{
$this->engine = null;

View File

@ -23,7 +23,7 @@ class RequestHelperTest extends TestCase
{
protected $requestStack;
protected function setUp()
protected function setUp(): void
{
$this->requestStack = new RequestStack();
$request = new Request();

View File

@ -25,7 +25,7 @@ class SessionHelperTest extends TestCase
{
protected $requestStack;
protected function setUp()
protected function setUp(): void
{
$request = new Request();
@ -39,7 +39,7 @@ class SessionHelperTest extends TestCase
$this->requestStack->push($request);
}
protected function tearDown()
protected function tearDown(): void
{
$this->requestStack = null;
}

View File

@ -22,12 +22,12 @@ class TemplateFilenameParserTest extends TestCase
{
protected $parser;
protected function setUp()
protected function setUp(): void
{
$this->parser = new TemplateFilenameParser();
}
protected function tearDown()
protected function tearDown(): void
{
$this->parser = null;
}

View File

@ -23,7 +23,7 @@ class TemplateNameParserTest extends TestCase
{
protected $parser;
protected function setUp()
protected function setUp(): void
{
$kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\KernelInterface')->getMock();
$kernel
@ -40,7 +40,7 @@ class TemplateNameParserTest extends TestCase
$this->parser = new TemplateNameParser($kernel);
}
protected function tearDown()
protected function tearDown(): void
{
$this->parser = null;
}

View File

@ -24,13 +24,13 @@ class TranslatorTest extends TestCase
{
protected $tmpDir;
protected function setUp()
protected function setUp(): void
{
$this->tmpDir = sys_get_temp_dir().'/sf_translation';
$this->deleteTmpDir();
}
protected function tearDown()
protected function tearDown(): void
{
$this->deleteTmpDir();
}

View File

@ -22,12 +22,12 @@ abstract class AbstractWebTestCase extends BaseWebTestCase
self::assertEquals('http://localhost'.$location, $response->headers->get('Location'));
}
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
static::deleteTmpDir();
}
public static function tearDownAfterClass()
public static function tearDownAfterClass(): void
{
static::deleteTmpDir();
}

View File

@ -286,7 +286,7 @@ EOTXT
], ['interactive' => false]);
}
protected function setUp()
protected function setUp(): void
{
putenv('COLUMNS='.(119 + \strlen(PHP_EOL)));
$kernel = $this->createKernel(['test_case' => 'PasswordEncode']);
@ -299,7 +299,7 @@ EOTXT
$this->passwordEncoderCommandTester = new CommandTester($passwordEncoderCommand);
}
protected function tearDown()
protected function tearDown(): void
{
$this->passwordEncoderCommandTester = null;
}

View File

@ -31,7 +31,7 @@ class TwigLoaderPassTest extends TestCase
*/
private $pass;
protected function setUp()
protected function setUp(): void
{
$this->builder = new ContainerBuilder();
$this->builder->register('twig');

View File

@ -47,12 +47,12 @@ class CacheWarmingTest extends TestCase
$this->assertFileExists($kernel->getCacheDir().'/twig');
}
protected function setUp()
protected function setUp(): void
{
$this->deleteTempDir();
}
protected function tearDown()
protected function tearDown(): void
{
$this->deleteTempDir();
}

View File

@ -30,12 +30,12 @@ class NoTemplatingEntryTest extends TestCase
$this->assertStringContainsString('{ a: b }', $content);
}
protected function setUp()
protected function setUp(): void
{
$this->deleteTempDir();
}
protected function tearDown()
protected function tearDown(): void
{
$this->deleteTempDir();
}

View File

@ -46,7 +46,7 @@ class WebProfilerExtensionTest extends TestCase
self::assertEquals([], $errors, $message);
}
protected function setUp()
protected function setUp(): void
{
parent::setUp();
@ -73,7 +73,7 @@ class WebProfilerExtensionTest extends TestCase
$this->container->addCompilerPass(new RegisterListenersPass());
}
protected function tearDown()
protected function tearDown(): void
{
parent::tearDown();

View File

@ -38,7 +38,7 @@ class TemplateManagerTest extends TestCase
*/
protected $templateManager;
protected function setUp()
protected function setUp(): void
{
parent::setUp();

View File

@ -28,7 +28,7 @@ abstract class AbstractRedisAdapterTest extends AdapterTestCase
return new RedisAdapter(self::$redis, str_replace('\\', '.', __CLASS__), $defaultLifetime);
}
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
if (!\extension_loaded('redis')) {
self::markTestSkipped('Extension redis required.');
@ -39,7 +39,7 @@ abstract class AbstractRedisAdapterTest extends AdapterTestCase
}
}
public static function tearDownAfterClass()
public static function tearDownAfterClass(): void
{
self::$redis = null;
}

View File

@ -21,7 +21,7 @@ use Symfony\Contracts\Cache\CallbackInterface;
abstract class AdapterTestCase extends CachePoolTest
{
protected function setUp()
protected function setUp(): void
{
parent::setUp();

View File

@ -24,7 +24,7 @@ class FilesystemAdapterTest extends AdapterTestCase
return new FilesystemAdapter('', $defaultLifetime);
}
public static function tearDownAfterClass()
public static function tearDownAfterClass(): void
{
self::rmdir(sys_get_temp_dir().'/symfony-cache');
}

View File

@ -23,7 +23,7 @@ class MemcachedAdapterTest extends AdapterTestCase
protected static $client;
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
if (!MemcachedAdapter::isSupported()) {
self::markTestSkipped('Extension memcached >=2.2.0 required.');

View File

@ -23,7 +23,7 @@ class PdoAdapterTest extends AdapterTestCase
protected static $dbFile;
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
if (!\extension_loaded('pdo_sqlite')) {
self::markTestSkipped('Extension pdo_sqlite required.');
@ -35,7 +35,7 @@ class PdoAdapterTest extends AdapterTestCase
$pool->createTable();
}
public static function tearDownAfterClass()
public static function tearDownAfterClass(): void
{
@unlink(self::$dbFile);
}

View File

@ -24,7 +24,7 @@ class PdoDbalAdapterTest extends AdapterTestCase
protected static $dbFile;
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
if (!\extension_loaded('pdo_sqlite')) {
self::markTestSkipped('Extension pdo_sqlite required.');
@ -35,7 +35,7 @@ class PdoDbalAdapterTest extends AdapterTestCase
$pool = new PdoAdapter(DriverManager::getConnection(['driver' => 'pdo_sqlite', 'path' => self::$dbFile]));
}
public static function tearDownAfterClass()
public static function tearDownAfterClass(): void
{
@unlink(self::$dbFile);
}

View File

@ -58,12 +58,12 @@ class PhpArrayAdapterTest extends AdapterTestCase
protected static $file;
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
self::$file = sys_get_temp_dir().'/symfony-cache/php-array-adapter-test.php';
}
protected function tearDown()
protected function tearDown(): void
{
if (file_exists(sys_get_temp_dir().'/symfony-cache')) {
FilesystemAdapterTest::rmdir(sys_get_temp_dir().'/symfony-cache');

View File

@ -30,12 +30,12 @@ class PhpArrayAdapterWithFallbackTest extends AdapterTestCase
protected static $file;
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
self::$file = sys_get_temp_dir().'/symfony-cache/php-array-adapter-test.php';
}
protected function tearDown()
protected function tearDown(): void
{
if (file_exists(sys_get_temp_dir().'/symfony-cache')) {
FilesystemAdapterTest::rmdir(sys_get_temp_dir().'/symfony-cache');

View File

@ -28,7 +28,7 @@ class PhpFilesAdapterTest extends AdapterTestCase
return new PhpFilesAdapter('sf-cache');
}
public static function tearDownAfterClass()
public static function tearDownAfterClass(): void
{
FilesystemAdapterTest::rmdir(sys_get_temp_dir().'/symfony-cache');
}

View File

@ -16,7 +16,7 @@ use Symfony\Component\Cache\Adapter\RedisAdapter;
class PredisAdapterTest extends AbstractRedisAdapterTest
{
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
parent::setupBeforeClass();
self::$redis = new \Predis\Client(['host' => getenv('REDIS_HOST')]);

View File

@ -13,13 +13,13 @@ namespace Symfony\Component\Cache\Tests\Adapter;
class PredisClusterAdapterTest extends AbstractRedisAdapterTest
{
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
parent::setupBeforeClass();
self::$redis = new \Predis\Client([['host' => getenv('REDIS_HOST')]]);
}
public static function tearDownAfterClass()
public static function tearDownAfterClass(): void
{
self::$redis = null;
}

View File

@ -15,7 +15,7 @@ use Symfony\Component\Cache\Adapter\RedisAdapter;
class PredisRedisClusterAdapterTest extends AbstractRedisAdapterTest
{
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
if (!$hosts = getenv('REDIS_CLUSTER_HOSTS')) {
self::markTestSkipped('REDIS_CLUSTER_HOSTS env var is not defined.');
@ -24,7 +24,7 @@ class PredisRedisClusterAdapterTest extends AbstractRedisAdapterTest
self::$redis = RedisAdapter::createConnection('redis:?host['.str_replace(' ', ']&host[', $hosts).']', ['class' => \Predis\Client::class, 'redis_cluster' => true]);
}
public static function tearDownAfterClass()
public static function tearDownAfterClass(): void
{
self::$redis = null;
}

View File

@ -17,7 +17,7 @@ use Symfony\Component\Cache\Traits\RedisProxy;
class RedisAdapterTest extends AbstractRedisAdapterTest
{
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
parent::setupBeforeClass();
self::$redis = AbstractAdapter::createConnection('redis://'.getenv('REDIS_HOST'), ['lazy' => true]);

View File

@ -13,7 +13,7 @@ namespace Symfony\Component\Cache\Tests\Adapter;
class RedisArrayAdapterTest extends AbstractRedisAdapterTest
{
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
parent::setupBeforeClass();
if (!class_exists('RedisArray')) {

View File

@ -17,7 +17,7 @@ use Symfony\Component\Cache\Traits\RedisClusterProxy;
class RedisClusterAdapterTest extends AbstractRedisAdapterTest
{
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
if (!class_exists('RedisCluster')) {
self::markTestSkipped('The RedisCluster class is required.');

View File

@ -29,7 +29,7 @@ class TagAwareAdapterTest extends AdapterTestCase
return new TagAwareAdapter(new FilesystemAdapter('', $defaultLifetime));
}
public static function tearDownAfterClass()
public static function tearDownAfterClass(): void
{
FilesystemAdapterTest::rmdir(sys_get_temp_dir().'/symfony-cache');
}

View File

@ -31,7 +31,7 @@ abstract class AbstractRedisCacheTest extends CacheTestCase
return new RedisCache(self::$redis, str_replace('\\', '.', __CLASS__), $defaultLifetime);
}
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
if (!\extension_loaded('redis')) {
self::markTestSkipped('Extension redis required.');
@ -42,7 +42,7 @@ abstract class AbstractRedisCacheTest extends CacheTestCase
}
}
public static function tearDownAfterClass()
public static function tearDownAfterClass(): void
{
self::$redis = null;
}

View File

@ -17,7 +17,7 @@ use Symfony\Component\Cache\PruneableInterface;
abstract class CacheTestCase extends SimpleCacheTest
{
protected function setUp()
protected function setUp(): void
{
parent::setUp();

View File

@ -27,7 +27,7 @@ class MemcachedCacheTest extends CacheTestCase
protected static $client;
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
if (!MemcachedCache::isSupported()) {
self::markTestSkipped('Extension memcached >=2.2.0 required.');

View File

@ -24,7 +24,7 @@ class PdoCacheTest extends CacheTestCase
protected static $dbFile;
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
if (!\extension_loaded('pdo_sqlite')) {
self::markTestSkipped('Extension pdo_sqlite required.');
@ -36,7 +36,7 @@ class PdoCacheTest extends CacheTestCase
$pool->createTable();
}
public static function tearDownAfterClass()
public static function tearDownAfterClass(): void
{
@unlink(self::$dbFile);
}

View File

@ -25,7 +25,7 @@ class PdoDbalCacheTest extends CacheTestCase
protected static $dbFile;
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
if (!\extension_loaded('pdo_sqlite')) {
self::markTestSkipped('Extension pdo_sqlite required.');
@ -37,7 +37,7 @@ class PdoDbalCacheTest extends CacheTestCase
$pool->createTable();
}
public static function tearDownAfterClass()
public static function tearDownAfterClass(): void
{
@unlink(self::$dbFile);
}

View File

@ -50,12 +50,12 @@ class PhpArrayCacheTest extends CacheTestCase
protected static $file;
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
self::$file = sys_get_temp_dir().'/symfony-cache/php-array-adapter-test.php';
}
protected function tearDown()
protected function tearDown(): void
{
if (file_exists(sys_get_temp_dir().'/symfony-cache')) {
FilesystemAdapterTest::rmdir(sys_get_temp_dir().'/symfony-cache');

View File

@ -37,12 +37,12 @@ class PhpArrayCacheWithFallbackTest extends CacheTestCase
protected static $file;
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
self::$file = sys_get_temp_dir().'/symfony-cache/php-array-adapter-test.php';
}
protected function tearDown()
protected function tearDown(): void
{
if (file_exists(sys_get_temp_dir().'/symfony-cache')) {
FilesystemAdapterTest::rmdir(sys_get_temp_dir().'/symfony-cache');

View File

@ -16,7 +16,7 @@ namespace Symfony\Component\Cache\Tests\Simple;
*/
class RedisArrayCacheTest extends AbstractRedisCacheTest
{
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
parent::setupBeforeClass();
if (!class_exists('RedisArray')) {

View File

@ -18,7 +18,7 @@ use Symfony\Component\Cache\Simple\RedisCache;
*/
class RedisCacheTest extends AbstractRedisCacheTest
{
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
parent::setupBeforeClass();
self::$redis = RedisCache::createConnection('redis://'.getenv('REDIS_HOST'));

View File

@ -16,7 +16,7 @@ namespace Symfony\Component\Cache\Tests\Simple;
*/
class RedisClusterCacheTest extends AbstractRedisCacheTest
{
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
if (!class_exists('RedisCluster')) {
self::markTestSkipped('The RedisCluster class is required.');

View File

@ -19,12 +19,12 @@ class ConfigCacheTest extends TestCase
{
private $cacheFile = null;
protected function setUp()
protected function setUp(): void
{
$this->cacheFile = tempnam(sys_get_temp_dir(), 'config_');
}
protected function tearDown()
protected function tearDown(): void
{
$files = [$this->cacheFile, $this->cacheFile.'.meta'];

View File

@ -18,7 +18,7 @@ class DirectoryResourceTest extends TestCase
{
protected $directory;
protected function setUp()
protected function setUp(): void
{
$this->directory = sys_get_temp_dir().\DIRECTORY_SEPARATOR.'symfonyDirectoryIterator';
if (!file_exists($this->directory)) {
@ -27,7 +27,7 @@ class DirectoryResourceTest extends TestCase
touch($this->directory.'/tmp.xml');
}
protected function tearDown()
protected function tearDown(): void
{
if (!is_dir($this->directory)) {
return;

View File

@ -20,14 +20,14 @@ class FileExistenceResourceTest extends TestCase
protected $file;
protected $time;
protected function setUp()
protected function setUp(): void
{
$this->file = realpath(sys_get_temp_dir()).'/tmp.xml';
$this->time = time();
$this->resource = new FileExistenceResource($this->file);
}
protected function tearDown()
protected function tearDown(): void
{
if (file_exists($this->file)) {
unlink($this->file);

View File

@ -20,7 +20,7 @@ class FileResourceTest extends TestCase
protected $file;
protected $time;
protected function setUp()
protected function setUp(): void
{
$this->file = sys_get_temp_dir().'/tmp.xml';
$this->time = time();
@ -28,7 +28,7 @@ class FileResourceTest extends TestCase
$this->resource = new FileResource($this->file);
}
protected function tearDown()
protected function tearDown(): void
{
if (!file_exists($this->file)) {
return;

View File

@ -16,7 +16,7 @@ use Symfony\Component\Config\Resource\GlobResource;
class GlobResourceTest extends TestCase
{
protected function tearDown()
protected function tearDown(): void
{
$dir = \dirname(__DIR__).'/Fixtures';
@rmdir($dir.'/TmpGlob');

View File

@ -20,12 +20,12 @@ class ResourceCheckerConfigCacheTest extends TestCase
{
private $cacheFile = null;
protected function setUp()
protected function setUp(): void
{
$this->cacheFile = tempnam(sys_get_temp_dir(), 'config_');
}
protected function tearDown()
protected function tearDown(): void
{
$files = [$this->cacheFile, "{$this->cacheFile}.meta"];

View File

@ -43,12 +43,12 @@ class ApplicationTest extends TestCase
private $colSize;
protected function setUp()
protected function setUp(): void
{
$this->colSize = getenv('COLUMNS');
}
protected function tearDown()
protected function tearDown(): void
{
putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS');
putenv('SHELL_VERBOSITY');
@ -56,7 +56,7 @@ class ApplicationTest extends TestCase
unset($_SERVER['SHELL_VERBOSITY']);
}
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
self::$fixturesPath = realpath(__DIR__.'/Fixtures/');
require_once self::$fixturesPath.'/FooCommand.php';

View File

@ -28,7 +28,7 @@ class CommandTest extends TestCase
{
protected static $fixturesPath;
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
self::$fixturesPath = __DIR__.'/../Fixtures/';
require_once self::$fixturesPath.'/TestCommand.php';

View File

@ -21,7 +21,7 @@ class LockableTraitTest extends TestCase
{
protected static $fixturesPath;
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
self::$fixturesPath = __DIR__.'/../Fixtures/';
require_once self::$fixturesPath.'/FooLockCommand.php';

View File

@ -25,13 +25,13 @@ class ProgressBarTest extends TestCase
{
private $colSize;
protected function setUp()
protected function setUp(): void
{
$this->colSize = getenv('COLUMNS');
putenv('COLUMNS=120');
}
protected function tearDown()
protected function tearDown(): void
{
putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS');
}

View File

@ -24,12 +24,12 @@ class TableTest extends TestCase
{
protected $stream;
protected function setUp()
protected function setUp(): void
{
$this->stream = fopen('php://memory', 'r+');
}
protected function tearDown()
protected function tearDown(): void
{
fclose($this->stream);
$this->stream = null;

View File

@ -25,7 +25,7 @@ class InputDefinitionTest extends TestCase
protected $foo1;
protected $foo2;
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
self::$fixtures = __DIR__.'/../Fixtures/';
}

View File

@ -19,12 +19,12 @@ class StreamOutputTest extends TestCase
{
protected $stream;
protected function setUp()
protected function setUp(): void
{
$this->stream = fopen('php://memory', 'a', false);
}
protected function tearDown()
protected function tearDown(): void
{
$this->stream = null;
}

View File

@ -28,7 +28,7 @@ class SymfonyStyleTest extends TestCase
protected $tester;
private $colSize;
protected function setUp()
protected function setUp(): void
{
$this->colSize = getenv('COLUMNS');
putenv('COLUMNS=121');
@ -36,7 +36,7 @@ class SymfonyStyleTest extends TestCase
$this->tester = new CommandTester($this->command);
}
protected function tearDown()
protected function tearDown(): void
{
putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS');
$this->command = null;

View File

@ -19,13 +19,13 @@ class TerminalTest extends TestCase
private $colSize;
private $lineSize;
protected function setUp()
protected function setUp(): void
{
$this->colSize = getenv('COLUMNS');
$this->lineSize = getenv('LINES');
}
protected function tearDown()
protected function tearDown(): void
{
putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS');
putenv($this->lineSize ? 'LINES' : 'LINES='.$this->lineSize);

View File

@ -23,7 +23,7 @@ class ApplicationTesterTest extends TestCase
protected $application;
protected $tester;
protected function setUp()
protected function setUp(): void
{
$this->application = new Application();
$this->application->setAutoExit(false);
@ -38,7 +38,7 @@ class ApplicationTesterTest extends TestCase
$this->tester->run(['command' => 'foo', 'foo' => 'bar'], ['interactive' => false, 'decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE]);
}
protected function tearDown()
protected function tearDown(): void
{
$this->application = null;
$this->tester = null;

View File

@ -27,7 +27,7 @@ class CommandTesterTest extends TestCase
protected $command;
protected $tester;
protected function setUp()
protected function setUp(): void
{
$this->command = new Command('foo');
$this->command->addArgument('command');
@ -38,7 +38,7 @@ class CommandTesterTest extends TestCase
$this->tester->execute(['foo' => 'bar'], ['interactive' => false, 'decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE]);
}
protected function tearDown()
protected function tearDown(): void
{
$this->command = null;
$this->tester = null;

View File

@ -23,7 +23,7 @@ class DebugClassLoaderTest extends TestCase
private $loader;
protected function setUp()
protected function setUp(): void
{
$this->errorReporting = error_reporting(E_ALL);
$this->loader = new ClassLoader();
@ -31,7 +31,7 @@ class DebugClassLoaderTest extends TestCase
DebugClassLoader::enable();
}
protected function tearDown()
protected function tearDown(): void
{
DebugClassLoader::disable();
spl_autoload_unregister([$this->loader, 'loadClass']);

View File

@ -21,12 +21,12 @@ require_once __DIR__.'/HeaderMock.php';
class ExceptionHandlerTest extends TestCase
{
protected function setUp()
protected function setUp(): void
{
testHeader();
}
protected function tearDown()
protected function tearDown(): void
{
testHeader();
}

Some files were not shown because too many files have changed in this diff Show More