Skip to content

Commit

Permalink
Make tests support phpunit 8
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Jul 31, 2019
1 parent 1a0bae0 commit 39c0132
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
7 changes: 5 additions & 2 deletions Tests/Command/LintCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -24,6 +25,8 @@
*/
class LintCommandTest extends TestCase
{
use ForwardCompatTestTrait;

private $files;

public function testLintCorrectFile()
Expand Down Expand Up @@ -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)) {
Expand Down
7 changes: 5 additions & 2 deletions Tests/DumperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@
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;
use Symfony\Component\Yaml\Yaml;

class DumperTest extends TestCase
{
use ForwardCompatTestTrait;

protected $parser;
protected $dumper;
protected $path;
Expand All @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion Tests/InlineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
3 changes: 3 additions & 0 deletions Tests/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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\Parser;
use Symfony\Component\Yaml\Tag\TaggedValue;
use Symfony\Component\Yaml\Yaml;

class ParserTest extends TestCase
{
use ForwardCompatTestTrait;

/** @var Parser */
protected $parser;

Expand Down

0 comments on commit 39c0132

Please sign in to comment.