Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
added file cache factory test
Browse files Browse the repository at this point in the history
  • Loading branch information
jmatosp committed Jan 11, 2016
1 parent db4d2e3 commit aff3514
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/CacheFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ public static function make($type = null, $arg0 = null, $arg1 = null)
return new RedisCache($arg0);

case self::FILE:
if (! static::isFilesWritable()) {
throw new CacheException('temp dir is not writable');
}
return new FileCache();

case self::TWO_LEVEL:
Expand Down
6 changes: 6 additions & 0 deletions tests/integration/CacheFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ public function testInvalidInstancesToRedisCache()
$cache = CacheFactory::make(CacheFactory::REDIS, 'this is not a Redis instance');
}

public function testFileCacgeFactory()
{
$cache = CacheFactory::make(CacheFactory::FILE);
$this->assertInstanceOf('Psr\Cache\CacheItemPoolInterface', $cache);
}

// /**
// * @expectedException \Psr\Cache\CacheException
// */
Expand Down

0 comments on commit aff3514

Please sign in to comment.