コード例 #1
0
 public function testSetSatisfied()
 {
     $result = $this->adapter->setSatisfied();
     $this->assertInstanceOf('ZfcUser\\Authentication\\Adapter\\AbstractAdapter', $result);
     $this->assertTrue($this->adapter->isSatisfied());
     $result = $this->adapter->setSatisfied(false);
     $this->assertInstanceOf('ZfcUser\\Authentication\\Adapter\\AbstractAdapter', $result);
     $this->assertFalse($this->adapter->isSatisfied());
 }
コード例 #2
0
ファイル: handle.php プロジェクト: zhaozhenxiang/MyDPByPHP
{
    public function __construct(adapter1 $a)
    {
        $this->action = $a;
    }
    public function start()
    {
        return $this->action->startstart();
    }
    public function finish()
    {
        return $this->action->finishfinish();
    }
}
class adapter1
{
    public function startstart()
    {
        return __CLASS__ . __FUNCTION__;
    }
    public function finishfinish()
    {
        return __CLASS__ . __FUNCTION__;
    }
}
$user = new user1();
var_dump($user->start());
var_dump($user->finish());
$adapter = new adapter(new adapter1());
var_dump($adapter->start());
var_dump($adapter->finish());