Skip to content

Commit

Permalink
add test for CacheException
Browse files Browse the repository at this point in the history
  • Loading branch information
koenpunt committed May 16, 2016
1 parent c88ec9a commit c12c0bd
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions test/CacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,20 @@ public function test_cache_expire()

public function test_namespace_is_set_properly()
{
Cache::$options['namespace'] = 'myapp';
$this->cache_get();
$this->assert_same("abcd", Cache::$adapter->read("myapp::1337"));
Cache::$options['namespace'] = 'myapp';
$this->cache_get();
$this->assert_same("abcd", Cache::$adapter->read("myapp::1337"));
}

/**
* @expectedException ActiveRecord\CacheException
*/
public function test_exception_when_connect_fails()
{
$stub = $this->getMockBuilder('ActiveRecord\Memcache')
->setMethods(array('connect'))
->setConstructorArgs(array(array('host' => '127.0.0.1')))
->getMock();
}
}
?>

0 comments on commit c12c0bd

Please sign in to comment.