public function test__construct() { $parser = new template\parser(); $this->assert->string($parser->getNamespace())->isEqualTo(template\parser::defaultNamespace)->object($parser->getAdapter())->isInstanceOf('mageekguy\\atoum\\adapter'); $parser = new template\parser($namespace = uniqid()); $this->assert->string($namespace)->isEqualTo($parser->getNamespace())->object($parser->getAdapter())->isInstanceOf('mageekguy\\atoum\\adapter'); $parser = new template\parser($namespace = rand(1, PHP_INT_MAX)); $this->assert->string($parser->getNamespace())->isEqualTo((string) $namespace)->object($parser->getAdapter())->isInstanceOf('mageekguy\\atoum\\adapter'); $parser = new template\parser($namespace = uniqid(), $adapter = new atoum\test\adapter()); $this->assert->string($parser->getNamespace())->isEqualTo((string) $namespace)->object($parser->getAdapter())->isIdenticalTo($adapter); }
public function testSetNamespace() { $this->if($parser = new template\parser())->then->object($parser->setNamespace($namespace = uniqid()))->isIdenticalTo($parser)->string($parser->getNamespace())->isEqualTo($namespace)->object($parser->setNamespace($namespace = rand(1, PHP_INT_MAX)))->isIdenticalTo($parser)->string($parser->getNamespace())->isEqualTo((string) $namespace); }