Skip to content

Commit e67beb1

Browse files
Make tests support phpunit 8
1 parent 87b5c68 commit e67beb1

File tree

7 files changed

+30
-9
lines changed

7 files changed

+30
-9
lines changed

Tests/Generator/Dumper/PhpGeneratorDumperTest.php

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

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1516
use Symfony\Component\Routing\Generator\Dumper\PhpGeneratorDumper;
1617
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
1718
use Symfony\Component\Routing\RequestContext;
@@ -20,6 +21,8 @@
2021

2122
class PhpGeneratorDumperTest extends TestCase
2223
{
24+
use ForwardCompatTestTrait;
25+
2326
/**
2427
* @var RouteCollection
2528
*/
@@ -40,7 +43,7 @@ class PhpGeneratorDumperTest extends TestCase
4043
*/
4144
private $largeTestTmpFilepath;
4245

43-
protected function setUp()
46+
private function doSetUp()
4447
{
4548
parent::setUp();
4649

@@ -52,7 +55,7 @@ protected function setUp()
5255
@unlink($this->largeTestTmpFilepath);
5356
}
5457

55-
protected function tearDown()
58+
private function doTearDown()
5659
{
5760
parent::tearDown();
5861

Tests/Loader/AnnotationClassLoaderTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,17 @@
1111

1212
namespace Symfony\Component\Routing\Tests\Loader;
1313

14+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1415
use Symfony\Component\Routing\Annotation\Route;
1516

1617
class AnnotationClassLoaderTest extends AbstractAnnotationLoaderTest
1718
{
19+
use ForwardCompatTestTrait;
20+
1821
protected $loader;
1922
private $reader;
2023

21-
protected function setUp()
24+
private function doSetUp()
2225
{
2326
parent::setUp();
2427

Tests/Loader/AnnotationDirectoryLoaderTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,18 @@
1111

1212
namespace Symfony\Component\Routing\Tests\Loader;
1313

14+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1415
use Symfony\Component\Config\FileLocator;
1516
use Symfony\Component\Routing\Loader\AnnotationDirectoryLoader;
1617

1718
class AnnotationDirectoryLoaderTest extends AbstractAnnotationLoaderTest
1819
{
20+
use ForwardCompatTestTrait;
21+
1922
protected $loader;
2023
protected $reader;
2124

22-
protected function setUp()
25+
private function doSetUp()
2326
{
2427
parent::setUp();
2528

Tests/Loader/AnnotationFileLoaderTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,19 @@
1111

1212
namespace Symfony\Component\Routing\Tests\Loader;
1313

14+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1415
use Symfony\Component\Config\FileLocator;
1516
use Symfony\Component\Routing\Annotation\Route;
1617
use Symfony\Component\Routing\Loader\AnnotationFileLoader;
1718

1819
class AnnotationFileLoaderTest extends AbstractAnnotationLoaderTest
1920
{
21+
use ForwardCompatTestTrait;
22+
2023
protected $loader;
2124
protected $reader;
2225

23-
protected function setUp()
26+
private function doSetUp()
2427
{
2528
parent::setUp();
2629

Tests/Loader/DirectoryLoaderTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Routing\Tests\Loader;
1313

14+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1415
use Symfony\Component\Config\FileLocator;
1516
use Symfony\Component\Config\Loader\LoaderResolver;
1617
use Symfony\Component\Routing\Loader\AnnotationFileLoader;
@@ -20,10 +21,12 @@
2021

2122
class DirectoryLoaderTest extends AbstractAnnotationLoaderTest
2223
{
24+
use ForwardCompatTestTrait;
25+
2326
private $loader;
2427
private $reader;
2528

26-
protected function setUp()
29+
private function doSetUp()
2730
{
2831
parent::setUp();
2932

Tests/Matcher/Dumper/PhpMatcherDumperTest.php

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

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1516
use Symfony\Component\Routing\Matcher\Dumper\PhpMatcherDumper;
1617
use Symfony\Component\Routing\Matcher\RedirectableUrlMatcherInterface;
1718
use Symfony\Component\Routing\Matcher\UrlMatcher;
@@ -21,6 +22,8 @@
2122

2223
class PhpMatcherDumperTest extends TestCase
2324
{
25+
use ForwardCompatTestTrait;
26+
2427
/**
2528
* @var string
2629
*/
@@ -31,15 +34,15 @@ class PhpMatcherDumperTest extends TestCase
3134
*/
3235
private $dumpPath;
3336

34-
protected function setUp()
37+
private function doSetUp()
3538
{
3639
parent::setUp();
3740

3841
$this->matcherClass = uniqid('ProjectUrlMatcher');
3942
$this->dumpPath = sys_get_temp_dir().\DIRECTORY_SEPARATOR.'php_matcher.'.$this->matcherClass.'.php';
4043
}
4144

42-
protected function tearDown()
45+
private function doTearDown()
4346
{
4447
parent::tearDown();
4548

Tests/RouterTest.php

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

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1516
use Symfony\Component\HttpFoundation\Request;
1617
use Symfony\Component\Routing\RouteCollection;
1718
use Symfony\Component\Routing\Router;
1819

1920
class RouterTest extends TestCase
2021
{
22+
use ForwardCompatTestTrait;
23+
2124
private $router = null;
2225

2326
private $loader = null;
2427

25-
protected function setUp()
28+
private function doSetUp()
2629
{
2730
$this->loader = $this->getMockBuilder('Symfony\Component\Config\Loader\LoaderInterface')->getMock();
2831
$this->router = new Router($this->loader, 'routing.yml');

0 commit comments

Comments
 (0)