Esempio n. 1
0
 public function test__construct()
 {
     $this->if($adapter = new atoum\test\adapter())->and($adapter->php_sapi_name = function () {
         return uniqid();
     })->then->exception(function () use(&$name, $adapter) {
         $generator = new phar\generator($name = uniqid(), $adapter);
     })->isInstanceOf('mageekguy\\atoum\\exceptions\\logic')->hasMessage('\'' . $name . '\' must be used in CLI only')->if($adapter->php_sapi_name = function () {
         return 'cli';
     })->and($generator = new phar\generator($name = uniqid(), $adapter))->then->object($generator->getAdapter())->isIdenticalTo($adapter)->object($generator->getLocale())->isInstanceOf('mageekguy\\atoum\\locale')->object($generator->getOutputWriter())->isInstanceOf('mageekguy\\atoum\\writer')->object($generator->getErrorWriter())->isInstanceOf('mageekguy\\atoum\\writer')->string($generator->getName())->isEqualTo($name)->variable($generator->getOriginDirectory())->isNull()->variable($generator->getDestinationDirectory())->isNull()->object($generator->getArgumentsParser())->isInstanceOf('mageekguy\\atoum\\script\\arguments\\parser');
 }
Esempio n. 2
0
 public function testSetOutputWriter()
 {
     $this->if($generator = new phar\generator(uniqid()))->then->object($generator->setOutputWriter($stdout = new atoum\writers\std\out()))->isIdenticalTo($generator)->object($generator->getOutputWriter())->isIdenticalTo($stdout);
 }