Skip to content

Commit e380cac

Browse files
Merge branch '3.4' into 4.3
* 3.4: [Cache] fix cs Make tests support phpunit 8
2 parents 1943171 + 5d175ab commit e380cac

File tree

6 files changed

+29
-11
lines changed

6 files changed

+29
-11
lines changed

Tests/ConfigCacheTest.php

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

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1516
use Symfony\Component\Config\ConfigCache;
1617
use Symfony\Component\Config\Tests\Resource\ResourceStub;
1718

1819
class ConfigCacheTest extends TestCase
1920
{
21+
use ForwardCompatTestTrait;
22+
2023
private $cacheFile = null;
2124

22-
protected function setUp()
25+
private function doSetUp()
2326
{
2427
$this->cacheFile = tempnam(sys_get_temp_dir(), 'config_');
2528
}
2629

27-
protected function tearDown()
30+
private function doTearDown()
2831
{
2932
$files = [$this->cacheFile, $this->cacheFile.'.meta'];
3033

Tests/Resource/DirectoryResourceTest.php

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

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1516
use Symfony\Component\Config\Resource\DirectoryResource;
1617

1718
class DirectoryResourceTest extends TestCase
1819
{
20+
use ForwardCompatTestTrait;
21+
1922
protected $directory;
2023

21-
protected function setUp()
24+
private function doSetUp()
2225
{
2326
$this->directory = sys_get_temp_dir().\DIRECTORY_SEPARATOR.'symfonyDirectoryIterator';
2427
if (!file_exists($this->directory)) {
@@ -27,7 +30,7 @@ protected function setUp()
2730
touch($this->directory.'/tmp.xml');
2831
}
2932

30-
protected function tearDown()
33+
private function doTearDown()
3134
{
3235
if (!is_dir($this->directory)) {
3336
return;

Tests/Resource/FileExistenceResourceTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,25 @@
1212
namespace Symfony\Component\Config\Tests\Resource;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1516
use Symfony\Component\Config\Resource\FileExistenceResource;
1617

1718
class FileExistenceResourceTest extends TestCase
1819
{
20+
use ForwardCompatTestTrait;
21+
1922
protected $resource;
2023
protected $file;
2124
protected $time;
2225

23-
protected function setUp()
26+
private function doSetUp()
2427
{
2528
$this->file = realpath(sys_get_temp_dir()).'/tmp.xml';
2629
$this->time = time();
2730
$this->resource = new FileExistenceResource($this->file);
2831
}
2932

30-
protected function tearDown()
33+
private function doTearDown()
3134
{
3235
if (file_exists($this->file)) {
3336
unlink($this->file);

Tests/Resource/FileResourceTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,26 @@
1212
namespace Symfony\Component\Config\Tests\Resource;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1516
use Symfony\Component\Config\Resource\FileResource;
1617

1718
class FileResourceTest extends TestCase
1819
{
20+
use ForwardCompatTestTrait;
21+
1922
protected $resource;
2023
protected $file;
2124
protected $time;
2225

23-
protected function setUp()
26+
private function doSetUp()
2427
{
2528
$this->file = sys_get_temp_dir().'/tmp.xml';
2629
$this->time = time();
2730
touch($this->file, $this->time);
2831
$this->resource = new FileResource($this->file);
2932
}
3033

31-
protected function tearDown()
34+
private function doTearDown()
3235
{
3336
if (!file_exists($this->file)) {
3437
return;

Tests/Resource/GlobResourceTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@
1212
namespace Symfony\Component\Config\Tests\Resource;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1516
use Symfony\Component\Config\Resource\GlobResource;
1617

1718
class GlobResourceTest extends TestCase
1819
{
19-
protected function tearDown()
20+
use ForwardCompatTestTrait;
21+
22+
private function doTearDown()
2023
{
2124
$dir = \dirname(__DIR__).'/Fixtures';
2225
@rmdir($dir.'/TmpGlob');

Tests/ResourceCheckerConfigCacheTest.php

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

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1516
use Symfony\Component\Config\Resource\FileResource;
1617
use Symfony\Component\Config\ResourceCheckerConfigCache;
1718
use Symfony\Component\Config\Tests\Resource\ResourceStub;
1819

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

23-
protected function setUp()
26+
private function doSetUp()
2427
{
2528
$this->cacheFile = tempnam(sys_get_temp_dir(), 'config_');
2629
}
2730

28-
protected function tearDown()
31+
private function doTearDown()
2932
{
3033
$files = [$this->cacheFile, "{$this->cacheFile}.meta"];
3134

0 commit comments

Comments
 (0)