Пример #1
0
 /**
  * Test get & set code by callable.
  *
  * @return void
  *
  * @since  1.0
  *
  * @covers Joomla\Console\Command\AbstractCommand::getHandler
  */
 public function testSetAndgetCallableHandler()
 {
     $this->instance->setHandler(array($this, 'fakeHandler'));
     $code = $this->instance->getHandler();
     $this->assertTrue(is_callable($code), 'Handler not exists');
     $this->assertEquals('Hello', $this->instance->execute(), 'Handler result failure.');
     $this->instance->setHandler(null);
     $this->assertEquals(null, $this->instance->getHandler(), 'Handler should have been cleaned');
 }