Merge branch '4.4'

* 4.4:
  Fix assertInternalType deprecation in phpunit 9
  Fix assertInternalType deprecation in phpunit 9
  Ensure signatures for setUp|tearDown|setUpAfterClass|tearDownAfterClass methods in tests are compatible with phpunit 8.2
This commit is contained in:
Nicolas Grekas 2019-08-01 13:53:34 +02:00
commit 41e931d772
54 changed files with 81 additions and 75 deletions

View File

@ -27,7 +27,7 @@ class DoctrineCloseConnectionMiddlewareTest extends MiddlewareTestCase
private $middleware; private $middleware;
private $entityManagerName = 'default'; private $entityManagerName = 'default';
protected function setUp() protected function setUp(): void
{ {
$this->connection = $this->createMock(Connection::class); $this->connection = $this->createMock(Connection::class);

View File

@ -27,7 +27,7 @@ class DoctrinePingConnectionMiddlewareTest extends MiddlewareTestCase
private $middleware; private $middleware;
private $entityManagerName = 'default'; private $entityManagerName = 'default';
protected function setUp() protected function setUp(): void
{ {
$this->connection = $this->createMock(Connection::class); $this->connection = $this->createMock(Connection::class);

View File

@ -25,7 +25,7 @@ class DoctrineTransactionMiddlewareTest extends MiddlewareTestCase
private $entityManager; private $entityManager;
private $middleware; private $middleware;
public function setUp() public function setUp(): void
{ {
$this->connection = $this->createMock(Connection::class); $this->connection = $this->createMock(Connection::class);

View File

@ -16,12 +16,12 @@ use Symfony\Bridge\PhpUnit\ClassExistsMock;
class ClassExistsMockTest extends TestCase class ClassExistsMockTest extends TestCase
{ {
public static function setUpBeforeClass() public static function setUpBeforeClass(): void
{ {
ClassExistsMock::register(__CLASS__); ClassExistsMock::register(__CLASS__);
} }
protected function setUp() protected function setUp(): void
{ {
ClassExistsMock::withMockedClasses([ ClassExistsMock::withMockedClasses([
ExistingClass::class => false, ExistingClass::class => false,

View File

@ -23,7 +23,7 @@ class CachePoolDeleteCommandTest extends TestCase
{ {
private $cachePool; private $cachePool;
protected function setUp() protected function setUp(): void
{ {
$this->cachePool = $this->getMockBuilder(CacheItemPoolInterface::class) $this->cachePool = $this->getMockBuilder(CacheItemPoolInterface::class)
->getMock(); ->getMock();

View File

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

View File

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

View File

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

View File

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

View File

@ -18,7 +18,7 @@ class PredisTagAwareAdapterTest extends PredisAdapterTest
{ {
use TagAwareTestTrait; use TagAwareTestTrait;
protected function setUp() protected function setUp(): void
{ {
parent::setUp(); parent::setUp();
$this->skippedTests['testTagItemExpiry'] = 'Testing expiration slows down the test suite'; $this->skippedTests['testTagItemExpiry'] = 'Testing expiration slows down the test suite';

View File

@ -18,7 +18,7 @@ class PredisTagAwareClusterAdapterTest extends PredisClusterAdapterTest
{ {
use TagAwareTestTrait; use TagAwareTestTrait;
protected function setUp() protected function setUp(): void
{ {
parent::setUp(); parent::setUp();
$this->skippedTests['testTagItemExpiry'] = 'Testing expiration slows down the test suite'; $this->skippedTests['testTagItemExpiry'] = 'Testing expiration slows down the test suite';

View File

@ -18,7 +18,7 @@ class PredisTagAwareRedisClusterAdapterTest extends PredisRedisClusterAdapterTes
{ {
use TagAwareTestTrait; use TagAwareTestTrait;
protected function setUp() protected function setUp(): void
{ {
parent::setUp(); parent::setUp();
$this->skippedTests['testTagItemExpiry'] = 'Testing expiration slows down the test suite'; $this->skippedTests['testTagItemExpiry'] = 'Testing expiration slows down the test suite';

View File

@ -19,7 +19,7 @@ class RedisTagAwareAdapterTest extends RedisAdapterTest
{ {
use TagAwareTestTrait; use TagAwareTestTrait;
protected function setUp() protected function setUp(): void
{ {
parent::setUp(); parent::setUp();
$this->skippedTests['testTagItemExpiry'] = 'Testing expiration slows down the test suite'; $this->skippedTests['testTagItemExpiry'] = 'Testing expiration slows down the test suite';

View File

@ -18,7 +18,7 @@ class RedisTagAwareArrayAdapterTest extends RedisArrayAdapterTest
{ {
use TagAwareTestTrait; use TagAwareTestTrait;
protected function setUp() protected function setUp(): void
{ {
parent::setUp(); parent::setUp();
$this->skippedTests['testTagItemExpiry'] = 'Testing expiration slows down the test suite'; $this->skippedTests['testTagItemExpiry'] = 'Testing expiration slows down the test suite';

View File

@ -19,7 +19,7 @@ class RedisTagAwareClusterAdapterTest extends RedisClusterAdapterTest
{ {
use TagAwareTestTrait; use TagAwareTestTrait;
protected function setUp() protected function setUp(): void
{ {
parent::setUp(); parent::setUp();
$this->skippedTests['testTagItemExpiry'] = 'Testing expiration slows down the test suite'; $this->skippedTests['testTagItemExpiry'] = 'Testing expiration slows down the test suite';

View File

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

View File

@ -21,7 +21,7 @@ use Symfony\Component\Cache\Psr16Cache;
*/ */
class Psr16CacheTest extends SimpleCacheTest class Psr16CacheTest extends SimpleCacheTest
{ {
protected function setUp() protected function setUp(): void
{ {
parent::setUp(); parent::setUp();

View File

@ -19,7 +19,7 @@ use Symfony\Component\VarDumper\Dumper\CliDumper;
class DumperNativeFallbackTest extends TestCase class DumperNativeFallbackTest extends TestCase
{ {
public static function setUpBeforeClass() public static function setUpBeforeClass(): void
{ {
ClassExistsMock::register(Dumper::class); ClassExistsMock::register(Dumper::class);
ClassExistsMock::withMockedClasses([ ClassExistsMock::withMockedClasses([
@ -27,7 +27,7 @@ class DumperNativeFallbackTest extends TestCase
]); ]);
} }
public static function tearDownAfterClass() public static function tearDownAfterClass(): void
{ {
ClassExistsMock::withMockedClasses([]); ClassExistsMock::withMockedClasses([]);
} }

View File

@ -20,13 +20,13 @@ class DumperTest extends TestCase
{ {
use VarDumperTestTrait; use VarDumperTestTrait;
public static function setUpBeforeClass() public static function setUpBeforeClass(): void
{ {
putenv('DUMP_LIGHT_ARRAY=1'); putenv('DUMP_LIGHT_ARRAY=1');
putenv('DUMP_COMMA_SEPARATOR=1'); putenv('DUMP_COMMA_SEPARATOR=1');
} }
public static function tearDownAfterClass() public static function tearDownAfterClass(): void
{ {
putenv('DUMP_LIGHT_ARRAY'); putenv('DUMP_LIGHT_ARRAY');
putenv('DUMP_COMMA_SEPARATOR'); putenv('DUMP_COMMA_SEPARATOR');

View File

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

View File

@ -19,7 +19,7 @@ class QuestionTest extends TestCase
{ {
private $question; private $question;
protected function setUp() protected function setUp(): void
{ {
parent::setUp(); parent::setUp();
$this->question = new Question('Test question'); $this->question = new Question('Test question');

View File

@ -26,7 +26,7 @@ class ContainerBagTest extends TestCase
/** @var ContainerBag */ /** @var ContainerBag */
private $containerBag; private $containerBag;
protected function setUp() protected function setUp(): void
{ {
$this->parameterBag = new ParameterBag(['foo' => 'value']); $this->parameterBag = new ParameterBag(['foo' => 'value']);
$this->containerBag = new ContainerBag(new Container($this->parameterBag)); $this->containerBag = new ContainerBag(new Container($this->parameterBag));

View File

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

View File

@ -31,13 +31,13 @@ class EventDispatcherTest extends TestCase
private $listener; private $listener;
protected function setUp() protected function setUp(): void
{ {
$this->dispatcher = $this->createEventDispatcher(); $this->dispatcher = $this->createEventDispatcher();
$this->listener = new TestEventListener(); $this->listener = new TestEventListener();
} }
protected function tearDown() protected function tearDown(): void
{ {
$this->dispatcher = null; $this->dispatcher = null;
$this->listener = null; $this->listener = null;

View File

@ -47,7 +47,7 @@ class IntlCallbackChoiceLoaderTest extends TestCase
*/ */
private static $lazyChoiceList; private static $lazyChoiceList;
public static function setUpBeforeClass() public static function setUpBeforeClass(): void
{ {
self::$loader = new IntlCallbackChoiceLoader(function () { self::$loader = new IntlCallbackChoiceLoader(function () {
return self::$choices; return self::$choices;
@ -98,7 +98,7 @@ class IntlCallbackChoiceLoaderTest extends TestCase
); );
} }
public static function tearDownAfterClass() public static function tearDownAfterClass(): void
{ {
self::$loader = null; self::$loader = null;
self::$value = null; self::$value = null;

View File

@ -18,12 +18,12 @@ class StringToFloatTransformerTest extends TestCase
{ {
private $transformer; private $transformer;
protected function setUp() protected function setUp(): void
{ {
$this->transformer = new StringToFloatTransformer(); $this->transformer = new StringToFloatTransformer();
} }
protected function tearDown() protected function tearDown(): void
{ {
$this->transformer = null; $this->transformer = null;
} }

View File

@ -11,10 +11,13 @@
namespace Symfony\Component\HttpClient\Tests; namespace Symfony\Component\HttpClient\Tests;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Contracts\HttpClient\Test\HttpClientTestCase as BaseHttpClientTestCase; use Symfony\Contracts\HttpClient\Test\HttpClientTestCase as BaseHttpClientTestCase;
abstract class HttpClientTestCase extends BaseHttpClientTestCase abstract class HttpClientTestCase extends BaseHttpClientTestCase
{ {
use ForwardCompatTestTrait;
public function testToStream() public function testToStream()
{ {
$client = $this->getHttpClient(__FUNCTION__); $client = $this->getHttpClient(__FUNCTION__);
@ -28,7 +31,7 @@ abstract class HttpClientTestCase extends BaseHttpClientTestCase
$this->assertFalse(feof($stream)); $this->assertFalse(feof($stream));
$this->assertTrue(rewind($stream)); $this->assertTrue(rewind($stream));
$this->assertInternalType('array', json_decode(fread($stream, 1024), true)); $this->assertIsArray(json_decode(fread($stream, 1024), true));
$this->assertSame('', fread($stream, 1)); $this->assertSame('', fread($stream, 1));
$this->assertTrue(feof($stream)); $this->assertTrue(feof($stream));
} }

View File

@ -23,7 +23,7 @@ class Psr18ClientTest extends TestCase
{ {
private static $server; private static $server;
public static function setUpBeforeClass() public static function setUpBeforeClass(): void
{ {
TestHttpServer::start(); TestHttpServer::start();
} }

View File

@ -37,7 +37,7 @@ abstract class AbstractRedisSessionHandlerTestCase extends TestCase
*/ */
abstract protected function createRedisClient(string $host); abstract protected function createRedisClient(string $host);
protected function setUp() protected function setUp(): void
{ {
parent::setUp(); parent::setUp();
@ -54,7 +54,7 @@ abstract class AbstractRedisSessionHandlerTestCase extends TestCase
); );
} }
protected function tearDown() protected function tearDown(): void
{ {
$this->redisClient = null; $this->redisClient = null;
$this->storage = null; $this->storage = null;

View File

@ -20,7 +20,7 @@ class MigratingSessionHandlerTest extends TestCase
private $currentHandler; private $currentHandler;
private $writeOnlyHandler; private $writeOnlyHandler;
protected function setUp() protected function setUp(): void
{ {
$this->currentHandler = $this->createMock(\SessionHandlerInterface::class); $this->currentHandler = $this->createMock(\SessionHandlerInterface::class);
$this->writeOnlyHandler = $this->createMock(\SessionHandlerInterface::class); $this->writeOnlyHandler = $this->createMock(\SessionHandlerInterface::class);

View File

@ -13,7 +13,7 @@ namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler;
class RedisClusterSessionHandlerTest extends AbstractRedisSessionHandlerTestCase class RedisClusterSessionHandlerTest extends AbstractRedisSessionHandlerTestCase
{ {
public static function setupBeforeClass() public static function setUpBeforeClass(): void
{ {
if (!class_exists('RedisCluster')) { if (!class_exists('RedisCluster')) {
self::markTestSkipped('The RedisCluster class is required.'); self::markTestSkipped('The RedisCluster class is required.');

View File

@ -26,7 +26,7 @@ class LocaleAwareListenerTest extends TestCase
private $localeAwareService; private $localeAwareService;
private $requestStack; private $requestStack;
protected function setUp() protected function setUp(): void
{ {
$this->localeAwareService = $this->getMockBuilder(LocaleAwareInterface::class)->getMock(); $this->localeAwareService = $this->getMockBuilder(LocaleAwareInterface::class)->getMock();
$this->requestStack = new RequestStack(); $this->requestStack = new RequestStack();

View File

@ -11,6 +11,7 @@
namespace Symfony\Component\Intl\Tests; namespace Symfony\Component\Intl\Tests;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\Intl\Currencies; use Symfony\Component\Intl\Currencies;
/** /**
@ -18,6 +19,8 @@ use Symfony\Component\Intl\Currencies;
*/ */
class CurrenciesTest extends ResourceBundleTestCase class CurrenciesTest extends ResourceBundleTestCase
{ {
use ForwardCompatTestTrait;
// The below arrays document the state of the ICU data bundled with this package. // The below arrays document the state of the ICU data bundled with this package.
private static $currencies = [ private static $currencies = [
@ -693,7 +696,7 @@ class CurrenciesTest extends ResourceBundleTestCase
*/ */
public function testGetRoundingIncrement($currency) public function testGetRoundingIncrement($currency)
{ {
$this->assertInternalType('numeric', Currencies::getRoundingIncrement($currency)); $this->assertIsNumeric(Currencies::getRoundingIncrement($currency));
} }
public function provideCurrenciesWithNumericEquivalent() public function provideCurrenciesWithNumericEquivalent()

View File

@ -696,7 +696,7 @@ abstract class ResourceBundleTestCase extends TestCase
private static $rootLocales; private static $rootLocales;
protected function setUp() protected function setUp(): void
{ {
Locale::setDefault('en'); Locale::setDefault('en');
Locale::setDefaultFallback('en'); Locale::setDefaultFallback('en');

View File

@ -25,7 +25,7 @@ class PdoDbalStoreTest extends AbstractStoreTest
protected static $dbFile; protected static $dbFile;
public static function setupBeforeClass() public static function setUpBeforeClass(): void
{ {
self::$dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_lock'); self::$dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_lock');
@ -33,7 +33,7 @@ class PdoDbalStoreTest extends AbstractStoreTest
$store->createTable(); $store->createTable();
} }
public static function tearDownAfterClass() public static function tearDownAfterClass(): void
{ {
@unlink(self::$dbFile); @unlink(self::$dbFile);
} }

View File

@ -25,7 +25,7 @@ class PdoStoreTest extends AbstractStoreTest
protected static $dbFile; protected static $dbFile;
public static function setupBeforeClass() public static function setUpBeforeClass(): void
{ {
self::$dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_lock'); self::$dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_lock');
@ -33,7 +33,7 @@ class PdoStoreTest extends AbstractStoreTest
$store->createTable(); $store->createTable();
} }
public static function tearDownAfterClass() public static function tearDownAfterClass(): void
{ {
@unlink(self::$dbFile); @unlink(self::$dbFile);
} }

View File

@ -26,12 +26,12 @@ use Symfony\Component\Messenger\Tests\Fixtures\MultipleBusesMessageHandler;
*/ */
class DebugCommandTest extends TestCase class DebugCommandTest extends TestCase
{ {
protected function setUp() protected function setUp(): void
{ {
putenv('COLUMNS='.(119 + \strlen(PHP_EOL))); putenv('COLUMNS='.(119 + \strlen(PHP_EOL)));
} }
protected function tearDown() protected function tearDown(): void
{ {
putenv('COLUMNS='); putenv('COLUMNS=');
} }

View File

@ -28,7 +28,7 @@ class MessengerDataCollectorTest extends TestCase
/** @var CliDumper */ /** @var CliDumper */
private $dumper; private $dumper;
protected function setUp() protected function setUp(): void
{ {
$this->dumper = new CliDumper(); $this->dumper = new CliDumper();
$this->dumper->setColors(false); $this->dumper->setColors(false);

View File

@ -36,7 +36,7 @@ use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
*/ */
class AmqpExtIntegrationTest extends TestCase class AmqpExtIntegrationTest extends TestCase
{ {
protected function setUp() protected function setUp(): void
{ {
parent::setUp(); parent::setUp();

View File

@ -28,7 +28,7 @@ class InMemoryTransportFactoryTest extends TestCase
*/ */
private $factory; private $factory;
protected function setUp() protected function setUp(): void
{ {
$this->factory = new InMemoryTransportFactory(); $this->factory = new InMemoryTransportFactory();
} }

View File

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

View File

@ -23,7 +23,7 @@ class RedisExtIntegrationTest extends TestCase
private $redis; private $redis;
private $connection; private $connection;
protected function setUp() protected function setUp(): void
{ {
if (!getenv('MESSENGER_REDIS_DSN')) { if (!getenv('MESSENGER_REDIS_DSN')) {
$this->markTestSkipped('The "MESSENGER_REDIS_DSN" environment variable is required.'); $this->markTestSkipped('The "MESSENGER_REDIS_DSN" environment variable is required.');

View File

@ -16,7 +16,7 @@ use Symfony\Component\Mime\MimeTypeGuesserInterface;
abstract class AbstractMimeTypeGuesserTest extends TestCase abstract class AbstractMimeTypeGuesserTest extends TestCase
{ {
public static function tearDownAfterClass() public static function tearDownAfterClass(): void
{ {
$path = __DIR__.'/Fixtures/mimetypes/to_delete'; $path = __DIR__.'/Fixtures/mimetypes/to_delete';
if (file_exists($path)) { if (file_exists($path)) {

View File

@ -41,7 +41,7 @@ class CompiledUrlGeneratorDumperTest extends TestCase
*/ */
private $largeTestTmpFilepath; private $largeTestTmpFilepath;
protected function setUp() protected function setUp(): void
{ {
parent::setUp(); parent::setUp();
@ -53,7 +53,7 @@ class CompiledUrlGeneratorDumperTest extends TestCase
@unlink($this->largeTestTmpFilepath); @unlink($this->largeTestTmpFilepath);
} }
protected function tearDown() protected function tearDown(): void
{ {
parent::tearDown(); parent::tearDown();

View File

@ -26,14 +26,14 @@ class CompiledUrlMatcherDumperTest extends TestCase
*/ */
private $dumpPath; private $dumpPath;
protected function setUp() protected function setUp(): void
{ {
parent::setUp(); parent::setUp();
$this->dumpPath = sys_get_temp_dir().\DIRECTORY_SEPARATOR.'php_matcher.'.uniqid('CompiledUrlMatcher').'.php'; $this->dumpPath = sys_get_temp_dir().\DIRECTORY_SEPARATOR.'php_matcher.'.uniqid('CompiledUrlMatcher').'.php';
} }
protected function tearDown() protected function tearDown(): void
{ {
parent::tearDown(); parent::tearDown();

View File

@ -16,7 +16,7 @@ use Symfony\Component\Security\Core\Encoder\SodiumPasswordEncoder;
class SodiumPasswordEncoderTest extends TestCase class SodiumPasswordEncoderTest extends TestCase
{ {
protected function setUp() protected function setUp(): void
{ {
if (!SodiumPasswordEncoder::isSupported()) { if (!SodiumPasswordEncoder::isSupported()) {
$this->markTestSkipped('Libsodium is not available.'); $this->markTestSkipped('Libsodium is not available.');

View File

@ -25,7 +25,7 @@ class ConstraintViolationListNormalizerTest extends TestCase
{ {
private $normalizer; private $normalizer;
protected function setUp() protected function setUp(): void
{ {
$this->normalizer = new ConstraintViolationListNormalizer(); $this->normalizer = new ConstraintViolationListNormalizer();
} }

View File

@ -24,7 +24,7 @@ class DateTimeZoneNormalizerTest extends TestCase
*/ */
private $normalizer; private $normalizer;
protected function setUp() protected function setUp(): void
{ {
$this->normalizer = new DateTimeZoneNormalizer(); $this->normalizer = new DateTimeZoneNormalizer();
} }

View File

@ -188,13 +188,13 @@ XLIFF;
return new CommandTester($command); return new CommandTester($command);
} }
protected function setUp() protected function setUp(): void
{ {
$this->files = []; $this->files = [];
@mkdir(sys_get_temp_dir().'/translation-xliff-lint-test'); @mkdir(sys_get_temp_dir().'/translation-xliff-lint-test');
} }
protected function tearDown() protected function tearDown(): void
{ {
foreach ($this->files as $file) { foreach ($this->files as $file) {
if (file_exists($file)) { if (file_exists($file)) {

View File

@ -23,7 +23,7 @@ class CliDescriptorTest extends TestCase
private static $timezone; private static $timezone;
private static $prevTerminalEmulator; private static $prevTerminalEmulator;
public static function setUpBeforeClass() public static function setUpBeforeClass(): void
{ {
self::$timezone = date_default_timezone_get(); self::$timezone = date_default_timezone_get();
date_default_timezone_set('UTC'); date_default_timezone_set('UTC');
@ -32,7 +32,7 @@ class CliDescriptorTest extends TestCase
putenv('TERMINAL_EMULATOR'); putenv('TERMINAL_EMULATOR');
} }
public static function tearDownAfterClass() public static function tearDownAfterClass(): void
{ {
date_default_timezone_set(self::$timezone); date_default_timezone_set(self::$timezone);
putenv('TERMINAL_EMULATOR'.(self::$prevTerminalEmulator ? '='.self::$prevTerminalEmulator : '')); putenv('TERMINAL_EMULATOR'.(self::$prevTerminalEmulator ? '='.self::$prevTerminalEmulator : ''));

View File

@ -21,13 +21,13 @@ class HtmlDescriptorTest extends TestCase
{ {
private static $timezone; private static $timezone;
public static function setUpBeforeClass() public static function setUpBeforeClass(): void
{ {
self::$timezone = date_default_timezone_get(); self::$timezone = date_default_timezone_get();
date_default_timezone_set('UTC'); date_default_timezone_set('UTC');
} }
public static function tearDownAfterClass() public static function tearDownAfterClass(): void
{ {
date_default_timezone_set(self::$timezone); date_default_timezone_set(self::$timezone);
} }

View File

@ -14,7 +14,7 @@ class InMemoryMetadataStoreTest extends TestCase
private $store; private $store;
private $transition; private $transition;
protected function setUp() protected function setUp(): void
{ {
$workflowMetadata = [ $workflowMetadata = [
'title' => 'workflow title', 'title' => 'workflow title',

View File

@ -71,7 +71,7 @@ class RegistryTest extends TestCase
public function testAllWithOneMatchWithSuccess() public function testAllWithOneMatchWithSuccess()
{ {
$workflows = $this->registry->all(new Subject1()); $workflows = $this->registry->all(new Subject1());
$this->assertInternalType('array', $workflows); $this->assertIsArray($workflows);
$this->assertCount(1, $workflows); $this->assertCount(1, $workflows);
$this->assertInstanceOf(Workflow::class, $workflows[0]); $this->assertInstanceOf(Workflow::class, $workflows[0]);
$this->assertSame('workflow1', $workflows[0]->getName()); $this->assertSame('workflow1', $workflows[0]->getName());
@ -80,7 +80,7 @@ class RegistryTest extends TestCase
public function testAllWithMultipleMatchWithSuccess() public function testAllWithMultipleMatchWithSuccess()
{ {
$workflows = $this->registry->all(new Subject2()); $workflows = $this->registry->all(new Subject2());
$this->assertInternalType('array', $workflows); $this->assertIsArray($workflows);
$this->assertCount(2, $workflows); $this->assertCount(2, $workflows);
$this->assertInstanceOf(Workflow::class, $workflows[0]); $this->assertInstanceOf(Workflow::class, $workflows[0]);
$this->assertInstanceOf(Workflow::class, $workflows[1]); $this->assertInstanceOf(Workflow::class, $workflows[1]);
@ -91,7 +91,7 @@ class RegistryTest extends TestCase
public function testAllWithNoMatch() public function testAllWithNoMatch()
{ {
$workflows = $this->registry->all(new \stdClass()); $workflows = $this->registry->all(new \stdClass());
$this->assertInternalType('array', $workflows); $this->assertIsArray($workflows);
$this->assertCount(0, $workflows); $this->assertCount(0, $workflows);
} }

View File

@ -25,12 +25,12 @@ class ParserTest extends TestCase
/** @var Parser */ /** @var Parser */
protected $parser; protected $parser;
protected function setUp() protected function setUp(): void
{ {
$this->parser = new Parser(); $this->parser = new Parser();
} }
protected function tearDown() protected function tearDown(): void
{ {
$this->parser = null; $this->parser = null;