Skip to content

Commit

Permalink
Remove dependency of phpunit-bridge (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
jderusse authored Nov 3, 2020
1 parent 9f1ef69 commit eda2e6b
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 22 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
"require": {
"php": ">=5.5.9",
"psr/cache": "~1.0",
"cache/tag-interop": "^1.0",
"symfony/phpunit-bridge": "^5.1"
"cache/tag-interop": "^1.0"
},
"require-dev": {
"cache/cache": "^1.0",
"symfony/cache": "^3.4.31|^4.3.4|^5.0",
"symfony/phpunit-bridge": "^5.1",
"illuminate/cache": "^5.4|^5.5|^5.6",
"tedivm/stash": "^0.14",
"mockery/mockery": "^1.0"
Expand Down
13 changes: 8 additions & 5 deletions src/CachePoolTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@
use PHPUnit\Framework\TestCase;
use Psr\Cache\CacheItemInterface;
use Psr\Cache\CacheItemPoolInterface;
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;

abstract class CachePoolTest extends TestCase
{
use SetUpTearDownTrait;

/**
* @type array with functionName => reason.
*/
Expand All @@ -35,12 +32,18 @@ abstract class CachePoolTest extends TestCase
*/
abstract public function createCachePool();

private function doSetUp()
/**
* @before
*/
public function setupService()
{
$this->cache = $this->createCachePool();
}

private function doTearDown()
/**
* @after
*/
public function tearDownService()
{
if ($this->cache !== null) {
$this->cache->clear();
Expand Down
13 changes: 8 additions & 5 deletions src/HierarchicalCachePoolTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@

use PHPUnit\Framework\TestCase;
use Psr\Cache\CacheItemPoolInterface;
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;

/**
* @author Tobias Nyholm <[email protected]>
*/
abstract class HierarchicalCachePoolTest extends TestCase
{
use SetUpTearDownTrait;

/**
* @type array with functionName => reason.
*/
Expand All @@ -37,12 +34,18 @@ abstract class HierarchicalCachePoolTest extends TestCase
*/
abstract public function createCachePool();

private function doSetUp()
/**
* @before
*/
public function setupService()
{
$this->cache = $this->createCachePool();
}

private function doTearDown()
/**
* @after
*/
public function tearDownService()
{
if ($this->cache !== null) {
$this->cache->clear();
Expand Down
13 changes: 8 additions & 5 deletions src/SimpleCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@

use PHPUnit\Framework\TestCase;
use Psr\SimpleCache\CacheInterface;
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;

abstract class SimpleCacheTest extends TestCase
{
use SetUpTearDownTrait;

/**
* @type array with functionName => reason.
*/
Expand Down Expand Up @@ -49,12 +46,18 @@ public function advanceTime($seconds)
sleep($seconds);
}

private function doSetUp()
/**
* @before
*/
public function setupService()
{
$this->cache = $this->createSimpleCache();
}

private function doTearDown()
/**
* @after
*/
public function tearDownService()
{
if ($this->cache !== null) {
$this->cache->clear();
Expand Down
13 changes: 8 additions & 5 deletions src/TaggableCachePoolTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@

use Cache\TagInterop\TaggableCacheItemPoolInterface;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;

/**
* @author Tobias Nyholm <[email protected]>
*/
abstract class TaggableCachePoolTest extends TestCase
{
use SetUpTearDownTrait;

/**
* @type array with functionName => reason.
*/
Expand All @@ -37,12 +34,18 @@ abstract class TaggableCachePoolTest extends TestCase
*/
abstract public function createCachePool();

private function doSetUp()
/**
* @before
*/
public function setupService()
{
$this->cache = $this->createCachePool();
}

private function doTearDown()
/**
* @after
*/
public function tearDownService()
{
if ($this->cache !== null) {
$this->cache->clear();
Expand Down

0 comments on commit eda2e6b

Please sign in to comment.