Exemple #1
0
 /**
  * Tests events_trigger_legacy() function.
  */
 public function test_events_trigger__cron()
 {
     events_update_definition('unittest');
     $this->assertDebuggingCalled(self::DEBUGGING_MSG, DEBUG_DEVELOPER);
     $this->assertEquals(0, events_trigger_legacy('test_cron', 'ok'));
     $this->assertEquals(0, eventslib_sample_handler_class::static_method('status'));
     events_cron('test_cron');
     // The events_cron one + one for each triggered event above (triggered in events_dispatch).
     $this->assertDebuggingCalledCount(2, array(self::DEBUGGING_MSG, self::DEBUGGING_MSG), array(DEBUG_DEVELOPER, DEBUG_DEVELOPER));
     $this->assertEquals(1, eventslib_sample_handler_class::static_method('status'));
 }
 /**
  * Tests events_trigger_legacy() function.
  */
 public function test_events_trigger__cron()
 {
     $this->assertEquals(0, events_trigger_legacy('test_cron', 'ok'));
     $this->assertEquals(0, eventslib_sample_handler_class::static_method('status'));
     events_cron('test_cron');
     $this->assertEquals(1, eventslib_sample_handler_class::static_method('status'));
 }