コード例 #1
0
 /**
  * Tests the JApplicationBase::triggerEvent method.
  *
  * @return  void
  *
  * @since   12.1
  */
 public function testTriggerEvent()
 {
     TestReflection::setValue($this->class, 'dispatcher', null);
     $this->assertNull($this->class->triggerEvent('onJApplicationBaseTriggerEvent'), 'Checks that for a non-dispatcher object, null is returned.');
     TestReflection::setValue($this->class, 'dispatcher', $this->getMockDispatcher());
     $this->class->registerEvent('onJApplicationBaseTriggerEvent', 'function');
     $this->assertEquals(array('function' => null), $this->class->triggerEvent('onJApplicationBaseTriggerEvent'), 'Checks the correct dispatcher method is called.');
 }