public function testCacheCleared()
{
$this->CachedDb->Permission = $this->getMockBuilder('Acl\\Model\\Table\\PermissionsTable')->getMock();
$this->CachedDb->Permission->expects($this->exactly(2))->method('check')->with('Samir', 'view', '*')->will($this->returnValue(true));
$this->CachedDb->Permission->expects($this->once())->method('allow')->with('Samir', 'view', '*', 1)->will($this->returnValue(true));
$this->assertTrue($this->CachedDb->check('Samir', 'view'));
$this->CachedDb->allow('Samir', 'view');
$this->assertTrue($this->CachedDb->check('Samir', 'view'));
}