Acl\Test\TestCase\Adapter\CacheDbAclTest::testCacheCleared PHP Method

testCacheCleared() public method

Tests that permissions cache is cleared when updated
public testCacheCleared ( ) : void
return void
    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'));
    }