public function setUp()
 {
     parent::setUp();
     $admin = $this->factory->user->create_and_get(array('role' => 'administrator'));
     $admin->add_cap('view_query_monitor');
     wp_set_current_user($admin->ID);
     $this->html = QM_Dispatchers::get('html');
     $this->assertInstanceOf('QM_Dispatcher_Html', $this->html);
     $this->html->init();
 }
Beispiel #2
0
 public function action_plugins_loaded()
 {
     # Register additional collectors:
     foreach (apply_filters('qm/collectors', array(), $this) as $collector) {
         QM_Collectors::add($collector);
     }
     # Load dispatchers:
     foreach (glob($this->plugin_path('dispatchers/*.php')) as $file) {
         include $file;
     }
     # Register built-in and additional dispatchers:
     foreach (apply_filters('qm/dispatchers', array(), $this) as $dispatcher) {
         QM_Dispatchers::add($dispatcher);
     }
 }
 public function action_init()
 {
     load_plugin_textdomain('query-monitor', false, dirname($this->plugin_base()) . '/languages');
     $dispatchers = QM_Dispatchers::init();
     foreach ($dispatchers as $dispatcher) {
         $dispatcher->init();
     }
 }