diff --git a/Tests/Command/LintCommandTest.php b/Tests/Command/LintCommandTest.php index 2bf0286b..cb86e951 100644 --- a/Tests/Command/LintCommandTest.php +++ b/Tests/Command/LintCommandTest.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Yaml\Tests\Command; use PHPUnit\Framework\TestCase; +use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait; use Symfony\Component\Console\Application; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Tester\CommandTester; @@ -24,6 +25,8 @@ */ class LintCommandTest extends TestCase { + use ForwardCompatTestTrait; + private $files; public function testLintCorrectFile() @@ -115,13 +118,13 @@ protected function createCommandTester() return new CommandTester($command); } - protected function setUp() + private function doSetUp() { $this->files = []; @mkdir(sys_get_temp_dir().'/framework-yml-lint-test'); } - protected function tearDown() + private function doTearDown() { foreach ($this->files as $file) { if (file_exists($file)) { diff --git a/Tests/DumperTest.php b/Tests/DumperTest.php index 1a9cac6f..0a85acd9 100644 --- a/Tests/DumperTest.php +++ b/Tests/DumperTest.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Yaml\Tests; use PHPUnit\Framework\TestCase; +use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait; use Symfony\Component\Yaml\Dumper; use Symfony\Component\Yaml\Parser; use Symfony\Component\Yaml\Tag\TaggedValue; @@ -19,6 +20,8 @@ class DumperTest extends TestCase { + use ForwardCompatTestTrait; + protected $parser; protected $dumper; protected $path; @@ -38,14 +41,14 @@ class DumperTest extends TestCase ], ]; - protected function setUp() + private function doSetUp() { $this->parser = new Parser(); $this->dumper = new Dumper(); $this->path = __DIR__.'/Fixtures'; } - protected function tearDown() + private function doTearDown() { $this->parser = null; $this->dumper = null; diff --git a/Tests/InlineTest.php b/Tests/InlineTest.php index 950c7023..2d699164 100644 --- a/Tests/InlineTest.php +++ b/Tests/InlineTest.php @@ -12,13 +12,16 @@ namespace Symfony\Component\Yaml\Tests; use PHPUnit\Framework\TestCase; +use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait; use Symfony\Component\Yaml\Exception\ParseException; use Symfony\Component\Yaml\Inline; use Symfony\Component\Yaml\Yaml; class InlineTest extends TestCase { - protected function setUp() + use ForwardCompatTestTrait; + + private function doSetUp() { Inline::initialize(0, 0); } diff --git a/Tests/ParserTest.php b/Tests/ParserTest.php index 4b5073fb..c3a03c24 100644 --- a/Tests/ParserTest.php +++ b/Tests/ParserTest.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Yaml\Tests; use PHPUnit\Framework\TestCase; +use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait; use Symfony\Component\Yaml\Exception\ParseException; use Symfony\Component\Yaml\Parser; use Symfony\Component\Yaml\Tag\TaggedValue; @@ -19,6 +20,8 @@ class ParserTest extends TestCase { + use ForwardCompatTestTrait; + /** @var Parser */ protected $parser;