Beispiel #1
0
 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);
 }
Beispiel #2
0
 public function testSetAdapter()
 {
     $this->if($parser = new template\parser())->then->object($parser->setAdapter($adapter = new atoum\test\adapter()))->isIdenticalTo($parser)->object($parser->getAdapter())->isIdenticalTo($adapter);
 }