Skip to content

Commit c12c0bd

Browse files
committed
add test for CacheException
1 parent c88ec9a commit c12c0bd

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

test/CacheTest.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,20 @@ public function test_cache_expire()
7474

7575
public function test_namespace_is_set_properly()
7676
{
77-
Cache::$options['namespace'] = 'myapp';
78-
$this->cache_get();
79-
$this->assert_same("abcd", Cache::$adapter->read("myapp::1337"));
77+
Cache::$options['namespace'] = 'myapp';
78+
$this->cache_get();
79+
$this->assert_same("abcd", Cache::$adapter->read("myapp::1337"));
80+
}
81+
82+
/**
83+
* @expectedException ActiveRecord\CacheException
84+
*/
85+
public function test_exception_when_connect_fails()
86+
{
87+
$stub = $this->getMockBuilder('ActiveRecord\Memcache')
88+
->setMethods(array('connect'))
89+
->setConstructorArgs(array(array('host' => '127.0.0.1')))
90+
->getMock();
8091
}
8192
}
8293
?>

0 commit comments

Comments
 (0)