mageekguy\atoum\mock\stream::setAdapter PHP Method

setAdapter() public static method

public static setAdapter ( mageekguy\atoum\adapter $adapter )
$adapter mageekguy\atoum\adapter
    public static function setAdapter(adapter $adapter)
    {
        static::$adapter = $adapter;
    }

Usage Example

Beispiel #1
0
 public function testGetSubStream()
 {
     $this->if(mock\stream::setAdapter($adapter = new test\adapter()))->and($adapter->stream_get_wrappers = array())->and($adapter->stream_wrapper_register = true)->and($stream = mock\stream::get())->then->string($stream . '\\' . uniqid())->match('#^' . $stream . preg_quote('\\') . '[^' . preg_quote('\\') . ']+$#')->object($subStream = mock\stream::getSubStream($stream))->isInstanceOf('mageekguy\\atoum\\mock\\stream\\controller')->castToString($subStream)->match('#^' . $stream . preg_quote(DIRECTORY_SEPARATOR) . '[^' . preg_quote(DIRECTORY_SEPARATOR) . ']+$#')->object($subStream = mock\stream::getSubStream($stream, $basename = uniqid()))->isInstanceOf('mageekguy\\atoum\\mock\\stream\\controller')->castToString($subStream)->match('#^' . $stream . preg_quote(DIRECTORY_SEPARATOR) . $basename . '$#');
 }