Example #1
0
 public function test_init_widgets()
 {
     $widget = new Widget();
     \WP_Mock::expectActionAdded('widgets_init', array($widget, 'registerWidgets'));
     $widget->init();
     \WP_Mock::wpPassthruFunction('register_widget', array('times' => 1, 'args' => array('Lnh\\Widget\\LastMatch\\LastMatch')));
     \WP_Mock::wpPassthruFunction('register_widget', array('times' => 1, 'args' => array('Lnh\\Widget\\NextMatch\\NextMatch')));
     \WP_Mock::wpPassthruFunction('register_widget', array('times' => 1, 'args' => array('Lnh\\Widget\\Calendar\\Calendar')));
     \WP_Mock::wpPassthruFunction('register_widget', array('times' => 1, 'args' => array('Lnh\\Widget\\Calendar\\Short\\CalendarShort')));
     \WP_Mock::wpPassthruFunction('register_widget', array('times' => 1, 'args' => array('Lnh\\Widget\\Classement\\Classement')));
     $widget->registerWidgets();
 }
Example #2
0
 /**
  * initialisation des widgets
  *
  * @return \Lnh\Widget\Widget
  */
 public function initWidgets()
 {
     $widget = new Widget();
     $widget->init();
     return $widget;
 }