/** * Tests the JApplicationCli::Execute method. * * @return void * * @since 11.3 */ public function testExecute() { // Manually inject the dispatcher. TestReflection::setValue($this->class, 'dispatcher', $this->getMockDispatcher()); // Register all the methods so that we can track if they have been fired. $this->class->registerEvent('onBeforeExecute', 'JWebTestExecute-onBeforeExecute')->registerEvent('JWebDoExecute', 'JWebTestExecute-JWebDoExecute')->registerEvent('onAfterExecute', 'JWebTestExecute-onAfterExecute'); $this->class->execute(); $this->assertEquals(array('onBeforeExecute', 'JWebDoExecute', 'onAfterExecute'), TestMockDispatcher::$triggered, 'Check that events fire in the right order.'); }
/** * Tests the JApplicationCli::Execute method. * * @return void * * @since 11.3 */ public function testExecute() { // Manually inject the dispatcher. $this->inspector->setClassProperty('dispatcher', $this->getMockDispatcher()); // Register all the methods so that we can track if they have been fired. $this->inspector->registerEvent('onBeforeExecute', 'JWebTestExecute-onBeforeExecute')->registerEvent('JWebDoExecute', 'JWebTestExecute-JWebDoExecute')->registerEvent('onAfterExecute', 'JWebTestExecute-onAfterExecute'); $this->inspector->execute(); $this->assertThat(JDispatcherGlobalMock::$triggered, $this->equalTo(array('onBeforeExecute', 'JWebDoExecute', 'onAfterExecute')), 'Check that events fire in the right order.'); }
/** * Tests the JApplicationCli::Execute method. * * @return void * * @since 11.3 */ public function testExecute() { $this->class->execute(); }