for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace CacheTests;
use kalanis\kw_cache\CacheException;
use kalanis\kw_cache\Interfaces\ICache;
use kalanis\kw_storage\Interfaces\IStorage;
use kalanis\kw_storage\Storage as XStorage;
abstract class ACacheTest extends \CommonTestClass
{
protected function getStorage(IStorage $mockStorage): XStorage\Storage
XStorage\Key\DirKey::setDir(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR);
$storage = new XStorage\Factory(new XStorage\Key\Factory(), new XStorage\Target\Factory());
return $storage->getStorage($mockStorage);
return $storage->getStorage($mockStorage)
null
kalanis\kw_storage\Storage\Storage
}
class MockCacheFail implements ICache
public function init(string $what): void
public function exists(): bool
return false;
public function set(string $content): bool
public function get(): string
return '';
public function clear(): void
class MockCacheKill implements ICache
return true;
throw new CacheException('mock test');