Location: PHPKode > projects > SolarPHP > solar-system-1.1.1/solar/source/solar/tests/Test/Solar/Role/Adapter/None.php
<?php
/**
 * 
 * Concrete adapter class test.
 * 
 */
class Test_Solar_Role_Adapter_None extends Test_Solar_Role_Adapter {
    
    /**
     * 
     * Default configuration values.
     * 
     * @var array
     * 
     */
    protected $_Test_Solar_Role_Adapter_None = array(
    );
    
    public function testFetch()
    {
        $expect = array();
        $actual = $this->_adapter->fetch('pmjones');
        $this->assertEquals($actual, $expect);
    }
    
    public function testLoad()
    {
        $this->_adapter->load('pmjones');
        $expect = array();
        $actual = $this->_adapter->getList();
        $this->assertEquals($actual, $expect);
    }
    
    public function testLoad_refresh()
    {
        // load the first time
        $this->_adapter->load('pmjones');
        $expect = array();
        $actual = $this->_adapter->getList();
        $this->assertEquals($actual, $expect);
        
        // foribly refresh
        $this->_adapter->load('boshag', true);
        $expect = array();
        $actual = $this->_adapter->getList();
        $this->assertEquals($actual, $expect);
    }
    
    public function testReset()
    {
        // load the first time
        $this->_adapter->load('pmjones');
        $expect = array();
        $actual = $this->_adapter->getList();
        $this->assertEquals($actual, $expect);
        
        // reset to empty
        $this->_adapter->reset();
        $expect = array();
        $actual = $this->_adapter->getList();
        $this->assertEquals($actual, $expect);
    }
    
    public function testIs()
    {
        $this->_adapter->load('pmjones');
        $actual = $this->_adapter->is('admin');
        $this->assertFalse($actual);
    }
    
    public function testIs_not()
    {
        $this->_adapter->load('pmjones');
        $actual = $this->_adapter->is('no-such-role');
        $this->assertFalse($actual);
    }
    
    public function testIsAny()
    {
        $this->_adapter->load('pmjones');
        $actual = $this->_adapter->isAny(array('no-such-role', 'root'));
        $this->assertFalse($actual);
    }
    
    public function testIsAny_not()
    {
        $this->_adapter->load('pmjones');
        $actual = $this->_adapter->isAny(array('no-such-role', 'no-other-role'));
        $this->assertFalse($actual);
    }
    
    public function testIsAll()
    {
        $this->_adapter->load('pmjones');
        $actual = $this->_adapter->isAll(array('admin', 'root'));
        $this->assertFalse($actual);
    }
    
    public function testIsAll_not()
    {
        $this->_adapter->load('pmjones');
        $actual = $this->_adapter->isAll(array('admin', 'root', 'no-such-role'));
        $this->assertFalse($actual);
    }
}
Return current item: SolarPHP