Skip to content

Commit

Permalink
Fix Import and Comments on Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
byjg committed Mar 11, 2018
1 parent 1b7b7ab commit e018431
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
26 changes: 17 additions & 9 deletions tests/CachePSR16Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Test;

use ByJG\Cache\Psr16\BaseCacheEngine;
use ByJG\Cache\Psr16\NoCacheEngine;

require_once 'BaseCacheTest.php';
Expand All @@ -11,8 +12,9 @@ class CachePSR16Test extends BaseCacheTest
/**
* @dataProvider CachePoolProvider
* @param \ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine
* @throws \Psr\SimpleCache\InvalidArgumentException
*/
public function testGetOneItem(\ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine)
public function testGetOneItem(BaseCacheEngine $cacheEngine)
{
$this->cacheEngine = $cacheEngine;

Expand All @@ -27,7 +29,7 @@ public function testGetOneItem(\ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine)
$cacheEngine->set('chave', 'valor');

// Get Object
if (!($cacheEngine instanceof \ByJG\Cache\Psr16\NoCacheEngine)) {
if (!($cacheEngine instanceof NoCacheEngine)) {
$item2 = $cacheEngine->get('chave', 'default');
$this->assertEquals('valor', $item2);
}
Expand All @@ -46,8 +48,10 @@ public function testGetOneItem(\ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine)
/**
* @dataProvider CachePoolProvider
* @param \ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine
* @throws \ByJG\Cache\InvalidArgumentException
* @throws \Psr\SimpleCache\InvalidArgumentException
*/
public function testGetMultipleItems(\ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine)
public function testGetMultipleItems(BaseCacheEngine $cacheEngine)
{
$this->cacheEngine = $cacheEngine;

Expand All @@ -65,7 +69,7 @@ public function testGetMultipleItems(\ByJG\Cache\Psr16\BaseCacheEngine $cacheEng
$cacheEngine->set('chave2', 'valor2');

// Get Object
if (!($cacheEngine instanceof \ByJG\Cache\Psr16\NoCacheEngine)) {
if (!($cacheEngine instanceof NoCacheEngine)) {
$item2 = $cacheEngine->getMultiple(['chave1', 'chave2']);
$this->assertEquals('valor1', $item2['chave1']);
$this->assertEquals('valor2', $item2['chave2']);
Expand All @@ -86,8 +90,9 @@ public function testGetMultipleItems(\ByJG\Cache\Psr16\BaseCacheEngine $cacheEng
/**
* @dataProvider CachePoolProvider
* @param \ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine
* @throws \Psr\SimpleCache\InvalidArgumentException
*/
public function testTtl(\ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine)
public function testTtl(BaseCacheEngine $cacheEngine)
{
$this->cacheEngine = $cacheEngine;

Expand All @@ -105,7 +110,7 @@ public function testTtl(\ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine)
$cacheEngine->set('chave2', 'valor2', 2);

// Get Object
if (!($cacheEngine instanceof \ByJG\Cache\Psr16\NoCacheEngine)) {
if (!($cacheEngine instanceof NoCacheEngine)) {
$item2 = $cacheEngine->get('chave');
$this->assertEquals('valor', $item2);
$this->assertTrue($cacheEngine->has('chave2'));
Expand All @@ -122,8 +127,9 @@ public function testTtl(\ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine)
/**
* @dataProvider CachePoolProvider
* @param \ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine
* @throws \Psr\SimpleCache\InvalidArgumentException
*/
public function testCacheObject(\ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine)
public function testCacheObject(BaseCacheEngine $cacheEngine)
{
$this->cacheEngine = $cacheEngine;

Expand All @@ -137,7 +143,7 @@ public function testCacheObject(\ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine)
$cacheEngine->set('chave', $model);

// Get Object
if (!($cacheEngine instanceof \ByJG\Cache\Psr16\NoCacheEngine)) {
if (!($cacheEngine instanceof NoCacheEngine)) {
$item2 = $cacheEngine->get('chave');
$this->assertEquals($model, $item2);
}
Expand All @@ -154,8 +160,10 @@ public function testCacheObject(\ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine)
/**
* @dataProvider CachePoolProvider
* @param \ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine
* @throws \ByJG\Cache\InvalidArgumentException
* @throws \Psr\SimpleCache\InvalidArgumentException
*/
public function testClear(\ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine)
public function testClear(BaseCacheEngine $cacheEngine)
{
$this->cacheEngine = $cacheEngine;

Expand Down
13 changes: 9 additions & 4 deletions tests/CachePSR6Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Test;

use ByJG\Cache\Psr16\BaseCacheEngine;
use ByJG\Cache\Psr6\CachePool;

require_once 'BaseCacheTest.php';
Expand All @@ -11,8 +12,9 @@ class CachePSR6Test extends BaseCacheTest
/**
* @dataProvider CachePoolProvider
* @param \ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine
* @throws \Psr\SimpleCache\InvalidArgumentException
*/
public function testGetOneItem(\ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine)
public function testGetOneItem(BaseCacheEngine $cacheEngine)
{
$this->cacheEngine = $cacheEngine;

Expand Down Expand Up @@ -46,8 +48,9 @@ public function testGetOneItem(\ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine)
/**
* @dataProvider CachePoolProvider
* @param \ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine
* @throws \Psr\SimpleCache\InvalidArgumentException
*/
public function testGetMultipleItems(\ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine)
public function testGetMultipleItems(BaseCacheEngine $cacheEngine)
{
$this->cacheEngine = $cacheEngine;

Expand Down Expand Up @@ -89,8 +92,9 @@ public function testGetMultipleItems(\ByJG\Cache\Psr16\BaseCacheEngine $cacheEng
/**
* @dataProvider CachePoolProvider
* @param \ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine
* @throws \Psr\SimpleCache\InvalidArgumentException
*/
public function testTtl(\ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine)
public function testTtl(BaseCacheEngine $cacheEngine)
{
$this->cacheEngine = $cacheEngine;

Expand Down Expand Up @@ -129,8 +133,9 @@ public function testTtl(\ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine)
/**
* @dataProvider CachePoolProvider
* @param \ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine
* @throws \Psr\SimpleCache\InvalidArgumentException
*/
public function testCacheObject(\ByJG\Cache\Psr16\BaseCacheEngine $cacheEngine)
public function testCacheObject(BaseCacheEngine $cacheEngine)
{
$this->cacheEngine = $cacheEngine;

Expand Down

0 comments on commit e018431

Please sign in to comment.