mageekguy\atoum\tests\units\scripts\phar\generator::testSetStubFile PHP Метод

testSetStubFile() публичный Метод

public testSetStubFile ( )
    public function testSetStubFile()
    {
        $this->if($adapter = new atoum\test\adapter())->and($adapter->php_sapi_name = function () {
            return 'cli';
        })->and($adapter->realpath = function ($path) {
            return $path;
        })->and($generator = new phar\generator(uniqid(), $adapter))->then->exception(function () use($generator) {
            $generator->setStubFile('');
        })->isInstanceOf('mageekguy\\atoum\\exceptions\\runtime')->hasMessage('Stub file is invalid')->if($adapter->is_file = function () {
            return false;
        })->then->exception(function () use($generator) {
            $generator->setStubFile(uniqid());
        })->isInstanceOf('mageekguy\\atoum\\exceptions\\runtime')->hasMessage('Stub file is not a valid file')->if($adapter->is_file = function () {
            return true;
        })->then->object($generator->setStubFile($stubFile = uniqid()))->isIdenticalTo($generator)->string($generator->getStubFile())->isEqualTo($stubFile);
    }