public function setUp() { parent::setUp(); update_option('page_comments', true); update_option('comments_per_page', 5); update_option('posts_per_page', 5); global $wp_rewrite; $wp_rewrite->init(); $wp_rewrite->set_permalink_structure($this->structure); create_initial_taxonomies(); $wp_rewrite->flush_rules(); }
/** * Set up the test fixture. * Override wp_die(), pretend to be ajax, and suppres E_WARNINGs */ public function setUp() { parent::setUp(); add_filter('wp_die_ajax_handler', array($this, 'getDieHandler'), 1, 1); set_current_screen('ajax'); // Clear logout cookies add_action('clear_auth_cookie', array($this, 'logout')); // Suppress warnings from "Cannot modify header information - headers already sent by" $this->_error_level = error_reporting(); error_reporting($this->_error_level & ~E_WARNING); // Make some posts self::factory()->post->create_many(5); }
function setUp() { parent::setUp(); add_filter('pre_option_enable_xmlrpc', '__return_true'); $this->myxmlrpcserver = new \wp_xmlrpc_server(); }