Skip to content

Commit 39c0132

Browse files
Make tests support phpunit 8
1 parent 1a0bae0 commit 39c0132

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

Tests/Command/LintCommandTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Yaml\Tests\Command;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1516
use Symfony\Component\Console\Application;
1617
use Symfony\Component\Console\Output\OutputInterface;
1718
use Symfony\Component\Console\Tester\CommandTester;
@@ -24,6 +25,8 @@
2425
*/
2526
class LintCommandTest extends TestCase
2627
{
28+
use ForwardCompatTestTrait;
29+
2730
private $files;
2831

2932
public function testLintCorrectFile()
@@ -115,13 +118,13 @@ protected function createCommandTester()
115118
return new CommandTester($command);
116119
}
117120

118-
protected function setUp()
121+
private function doSetUp()
119122
{
120123
$this->files = [];
121124
@mkdir(sys_get_temp_dir().'/framework-yml-lint-test');
122125
}
123126

124-
protected function tearDown()
127+
private function doTearDown()
125128
{
126129
foreach ($this->files as $file) {
127130
if (file_exists($file)) {

Tests/DumperTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@
1212
namespace Symfony\Component\Yaml\Tests;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1516
use Symfony\Component\Yaml\Dumper;
1617
use Symfony\Component\Yaml\Parser;
1718
use Symfony\Component\Yaml\Tag\TaggedValue;
1819
use Symfony\Component\Yaml\Yaml;
1920

2021
class DumperTest extends TestCase
2122
{
23+
use ForwardCompatTestTrait;
24+
2225
protected $parser;
2326
protected $dumper;
2427
protected $path;
@@ -38,14 +41,14 @@ class DumperTest extends TestCase
3841
],
3942
];
4043

41-
protected function setUp()
44+
private function doSetUp()
4245
{
4346
$this->parser = new Parser();
4447
$this->dumper = new Dumper();
4548
$this->path = __DIR__.'/Fixtures';
4649
}
4750

48-
protected function tearDown()
51+
private function doTearDown()
4952
{
5053
$this->parser = null;
5154
$this->dumper = null;

Tests/InlineTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@
1212
namespace Symfony\Component\Yaml\Tests;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1516
use Symfony\Component\Yaml\Exception\ParseException;
1617
use Symfony\Component\Yaml\Inline;
1718
use Symfony\Component\Yaml\Yaml;
1819

1920
class InlineTest extends TestCase
2021
{
21-
protected function setUp()
22+
use ForwardCompatTestTrait;
23+
24+
private function doSetUp()
2225
{
2326
Inline::initialize(0, 0);
2427
}

Tests/ParserTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@
1212
namespace Symfony\Component\Yaml\Tests;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1516
use Symfony\Component\Yaml\Exception\ParseException;
1617
use Symfony\Component\Yaml\Parser;
1718
use Symfony\Component\Yaml\Tag\TaggedValue;
1819
use Symfony\Component\Yaml\Yaml;
1920

2021
class ParserTest extends TestCase
2122
{
23+
use ForwardCompatTestTrait;
24+
2225
/** @var Parser */
2326
protected $parser;
2427

0 commit comments

Comments
 (0)