Exemplo n.º 1
0
 /**
  * @covers Xoops\Core\Handler\Scheme\FQN::build
  */
 public function testBuild_optional()
 {
     $name = '\\Xoops\\Core\\Kernel\\Handlers\\NoSuchName';
     $spec = Factory::getInstance()->newSpec()->scheme('fqn')->name($name)->optional(true);
     $handler = $this->object->build($spec);
     $this->assertNull($handler);
     $name = '\\Xoops\\Core\\Kernel\\Handlers\\XoopsUserHandler';
     $spec = Factory::getInstance()->newSpec()->scheme('fqn')->name($name)->optional(true);
     $handler = $this->object->build($spec);
     $this->assertInstanceOf('\\Xoops\\Core\\Kernel\\Handlers\\XoopsUserHandler', $handler);
 }
Exemplo n.º 2
0
 /**
  * @covers Xoops\Core\Handler\Scheme\SchemeInterface::build
  */
 public function testBuild()
 {
     $spec = Factory::getInstance()->newSpec();
     $this->assertNull($this->object->build($spec));
 }
Exemplo n.º 3
0
 /**
  * @param string $name that would be supplied to Xoops::getHandler()
  * @param string $handlerClass FQN of expected handler class
  *
  * @dataProvider handlerValueProvider
  * @covers Xoops\Core\Handler\Scheme\Kernel::build
  */
 public function testBuild($name, $handlerClass)
 {
     $spec = Factory::getInstance()->newSpec()->scheme('kernel')->name($name);
     $this->assertInstanceOf($handlerClass, $this->object->build($spec));
 }