Commit 943f1291 authored by Shawn Barratt's avatar Shawn Barratt
Browse files

Merged branch 0.1 into master

parents 5fadc944 112c967e
/.phpintel/
/vendor/
*.lock
......@@ -4,13 +4,14 @@ namespace Ethereal;
use Predis\Client;
class Cache extends Predis\Client implements Ethereal\Cache\Interface
class Cache extends \Predis\Client implements Cache\CacheInterface
{
protected $namespace = '';
protected $server;
public function __construct($server)
public function __construct(array $server)
{
parent::__construct($server);
$this->server = $server;
}
......
<?php
namespace Ethereal\Cache;
interface CacheInterface
{
public function get($term);
public function set($term, $value);
public function setNamespace($term);
}
<?php
namespace Ethereal;
require_once dirname(dirname(__DIR__)).'/vendor/autoload.php';
class CacheTest extends \PHPUnit_Framework_TestCase
{
public $cache;
public function setup()
{
$this->cache = new Cache([
'scheme' => 'tcp',
'host' => 'redis',
'port' => 6379,
], [
'profile' => '3.0.3'
]);
$this->cache->setNamespace('CacheTest');
}
public function testCacheRetrieve()
{
$varName = 'testfield';
$varValue = 'testValue';
$this->cache->set($varName, $varValue);
$this->assertTrue(($this->cache->get($varName) == $varValue));
}
}
\ No newline at end of file
<phpunit verbose="true" colors="true">
<testsuites>
<testsuite name="Ethereal lib Tests">
<directory suffix="Test.php">lib/tests</directory>
</testsuite>
</testsuites>
</phpunit>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment