Skip to content

Commit eda2e6b

Browse files
authored
Remove dependency of phpunit-bridge (#112)
1 parent 9f1ef69 commit eda2e6b

File tree

5 files changed

+34
-22
lines changed

5 files changed

+34
-22
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
"require": {
2626
"php": ">=5.5.9",
2727
"psr/cache": "~1.0",
28-
"cache/tag-interop": "^1.0",
29-
"symfony/phpunit-bridge": "^5.1"
28+
"cache/tag-interop": "^1.0"
3029
},
3130
"require-dev": {
3231
"cache/cache": "^1.0",
3332
"symfony/cache": "^3.4.31|^4.3.4|^5.0",
33+
"symfony/phpunit-bridge": "^5.1",
3434
"illuminate/cache": "^5.4|^5.5|^5.6",
3535
"tedivm/stash": "^0.14",
3636
"mockery/mockery": "^1.0"

src/CachePoolTest.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,9 @@
1414
use PHPUnit\Framework\TestCase;
1515
use Psr\Cache\CacheItemInterface;
1616
use Psr\Cache\CacheItemPoolInterface;
17-
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
1817

1918
abstract class CachePoolTest extends TestCase
2019
{
21-
use SetUpTearDownTrait;
22-
2320
/**
2421
* @type array with functionName => reason.
2522
*/
@@ -35,12 +32,18 @@ abstract class CachePoolTest extends TestCase
3532
*/
3633
abstract public function createCachePool();
3734

38-
private function doSetUp()
35+
/**
36+
* @before
37+
*/
38+
public function setupService()
3939
{
4040
$this->cache = $this->createCachePool();
4141
}
4242

43-
private function doTearDown()
43+
/**
44+
* @after
45+
*/
46+
public function tearDownService()
4447
{
4548
if ($this->cache !== null) {
4649
$this->cache->clear();

src/HierarchicalCachePoolTest.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,12 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Psr\Cache\CacheItemPoolInterface;
16-
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
1716

1817
/**
1918
* @author Tobias Nyholm <[email protected]>
2019
*/
2120
abstract class HierarchicalCachePoolTest extends TestCase
2221
{
23-
use SetUpTearDownTrait;
24-
2522
/**
2623
* @type array with functionName => reason.
2724
*/
@@ -37,12 +34,18 @@ abstract class HierarchicalCachePoolTest extends TestCase
3734
*/
3835
abstract public function createCachePool();
3936

40-
private function doSetUp()
37+
/**
38+
* @before
39+
*/
40+
public function setupService()
4141
{
4242
$this->cache = $this->createCachePool();
4343
}
4444

45-
private function doTearDown()
45+
/**
46+
* @after
47+
*/
48+
public function tearDownService()
4649
{
4750
if ($this->cache !== null) {
4851
$this->cache->clear();

src/SimpleCacheTest.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Psr\SimpleCache\CacheInterface;
16-
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
1716

1817
abstract class SimpleCacheTest extends TestCase
1918
{
20-
use SetUpTearDownTrait;
21-
2219
/**
2320
* @type array with functionName => reason.
2421
*/
@@ -49,12 +46,18 @@ public function advanceTime($seconds)
4946
sleep($seconds);
5047
}
5148

52-
private function doSetUp()
49+
/**
50+
* @before
51+
*/
52+
public function setupService()
5353
{
5454
$this->cache = $this->createSimpleCache();
5555
}
5656

57-
private function doTearDown()
57+
/**
58+
* @after
59+
*/
60+
public function tearDownService()
5861
{
5962
if ($this->cache !== null) {
6063
$this->cache->clear();

src/TaggableCachePoolTest.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,12 @@
1313

1414
use Cache\TagInterop\TaggableCacheItemPoolInterface;
1515
use PHPUnit\Framework\TestCase;
16-
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
1716

1817
/**
1918
* @author Tobias Nyholm <[email protected]>
2019
*/
2120
abstract class TaggableCachePoolTest extends TestCase
2221
{
23-
use SetUpTearDownTrait;
24-
2522
/**
2623
* @type array with functionName => reason.
2724
*/
@@ -37,12 +34,18 @@ abstract class TaggableCachePoolTest extends TestCase
3734
*/
3835
abstract public function createCachePool();
3936

40-
private function doSetUp()
37+
/**
38+
* @before
39+
*/
40+
public function setupService()
4141
{
4242
$this->cache = $this->createCachePool();
4343
}
4444

45-
private function doTearDown()
45+
/**
46+
* @after
47+
*/
48+
public function tearDownService()
4649
{
4750
if ($this->cache !== null) {
4851
$this->cache->clear();

0 commit comments

Comments
 (0)