mageekguy\atoum\php\mocker::setAdapter PHP Method

setAdapter() public static method

public static setAdapter ( mageekguy\atoum\test\adapter $adapter = null )
$adapter mageekguy\atoum\test\adapter
    public static function setAdapter(atoum\test\adapter $adapter = null)
    {
        static::$adapter = $adapter ?: new atoum\php\mocker\adapter();
    }

Usage Example

コード例 #1
0
ファイル: funktion.php プロジェクト: xihewang/atoum
 public function testResetCalls()
 {
     $this->given($this->newTestedInstance)->if($this->mockGenerator->orphanize('__construct')->orphanize('resetCalls'), php\mocker::setAdapter($adapter = new \mock\atoum\test\adapter()))->then->object($this->testedInstance->resetCalls())->isTestedInstance->mock($adapter)->call('resetCalls')->once->object($this->testedInstance->resetCalls($functionName = uniqid()))->isTestedInstance->mock($adapter)->call('resetCalls')->withArguments($functionName)->once->if($this->testedInstance->setDefaultNamespace($defaultNamespace = uniqid()))->then->object($this->testedInstance->resetCalls($functionName = uniqid()))->isTestedInstance->mock($adapter)->call('resetCalls')->withArguments($defaultNamespace . '\\' . $functionName)->once;
 }
All Usage Examples Of mageekguy\atoum\php\mocker::setAdapter