Example #1
0
 /**
  * Emptys the mocked_functions array
  */
 public function flush()
 {
     $this->mocked_functions = array();
     Handler::cleanup();
     $this->patchwork_functions = array();
     if (function_exists('Patchwork\\undoAll')) {
         \Patchwork\undoAll();
     }
     if (empty(self::$wp_mocked_functions)) {
         self::$wp_mocked_functions = array('add_action', 'do_action', 'add_filter', 'apply_filters');
     }
 }
Example #2
0
 /**
  * Tear down anything built up inside Mockery when we're ready to do so.
  */
 public static function tearDown()
 {
     self::$event_manager->flush();
     self::$function_manager->flush();
     \Mockery::close();
     \WP_Mock\Handler::cleanup();
 }