function setUp() { _reset_wp(); $this->cp = new ComicPress(); vfsStreamWrapper::register(); vfsStreamWrapper::setRoot(new vfsStreamDirectory('root')); }
public function setUp() { global $comicpress_manager; _reset_wp(); $this->cpm = new ComicPressManager(); $comicpress_manager = $this->cpm; }
function setUp() { _reset_wp(); $this->fa = new ComicPressBackendFilesystemFactory(); vfsStreamWrapper::register(); vfsStreamWrapper::setRoot(new vfsStreamDirectory('root')); }
function setUp() { _reset_wp(); $_GET = array(); _set_current_option('is_admin', true); $this->m = new PluginWonderfulViewMain(); }
function setUp() { global $post; _reset_wp(); unset($post); $this->cp = new ComicPress(); }
function testGetDefaultDisplayOptions() { _reset_wp(); $this->assertFalse(get_option('hubblesite-daily-image-options')); $this->diw->get_display_options(); $this->assertTrue(get_option('hubblesite-daily-image-options') !== false); }
function setUp() { global $wp_xmlrpc_server, $wpdb; $wp_xmlrpc_server = $this->getMock('wp_xmlrpc_server', array('escape', 'login')); $wp_xmlrpc_server->expects($this->atLeastOnce())->method('escape')->will($this->returnArgument(0)); $wpdb = $this->getMock('wpdb', array('get_results', 'prepare')); _reset_wp(); }
function setUp() { _reset_wp(); $this->pf = new PostFixtures(); $_POST = array(); vfsStreamWrapper::register(); vfsStreamWrapper::setRoot(new vfsStreamDirectory('root')); }
function setUp() { _reset_wp(); $this->cpmh = new ComicPressMediaHandling(); $this->default_filter = $this->cpmh->default_filter; vfsStreamWrapper::register(); vfsStreamWrapper::setRoot(new vfsStreamDirectory('root')); }
function setUp() { _reset_wp(); wp_insert_user(array('ID' => 1)); wp_set_current_user(1); wp_insert_post(array('ID' => 1)); $this->w = new WDTSTranscriptManager(1); $this->w->key = "test"; $this->w->search_key = "test_search"; }
function setUp() { global $comicpress_manager; _reset_wp(); $comicpress_manager = $this->getMock('ComicPressManager', array('generate_example_date', 'get_subcomic_directory', 'normalize_storyline_structure')); $comicpress_manager->expects($this->once())->method('generate_example_date'); $comicpress_manager->expects($this->once())->method('get_subcomic_directory')->will($this->returnValue(false)); $comicpress_manager->expects($this->once())->method('normalize_storyline_structure')->will($this->returnValue(array('category_tree' => array('0/1')))); $comicpress_manager->properties = array('comiccat' => 1); add_category(1, (object) array('name' => 'comic')); $this->u = new ComicPressUpload(); }
function setUp() { _reset_wp(); $this->w = new ComicPressGraphicalNavigationWidget(); }
function setUp() { _reset_wp(); $this->l = new WDTSLanguageOptions(); }
function setUp() { _reset_wp(); wp_cache_flush(); $this->css = new ComicPressStoryline(); }
function setUp() { _reset_wp(); $_POST = $_REQUEST = array(); $this->admin = new ComicPressAdmin(); }
function setUp() { _reset_wp(); }
function testSetupAdminMenu() { global $comicpress_manager, $plugin_page, $wp_test_expectations, $pagenow; $comicpress_manager = $this->getMock('ComicPressManager', array('read_information_and_check_config')); $comicpress_manager->expects($this->any())->method('read_information_and_check_config'); $plugin_page = "meow"; $this->adm->setup_admin_menu(); foreach (array(array('menu', 'ComicPress', '_index_caller'), array('submenu', 'Upload', '_index_caller'), array('submenu', 'Import', '_import_caller'), array('submenu', 'Bulk Edit', '_bulk_edit_caller'), array('submenu', 'Storyline Structure', '_storyline_caller'), array('submenu', 'Change Dates', '_dates_caller'), array('submenu', 'ComicPress Config', '_comicpress_config_caller'), array('submenu', 'Manager Config', '_manager_config_caller')) as $info) { list($type, $name, $function) = $info; $found = false; foreach ($wp_test_expectations['pages'] as $page) { if ($page['menu_title'] == $name) { switch ($type) { case "menu": $this->assertEquals("", $page['parent']); break; case "submenu": $this->assertNotEquals("", $page['parent']); break; } $this->assertEquals(array($this->adm, $function), $page['function'], "callback for {$name} not set"); $found = true; break; } } if (!$found) { $this->assertFalse(true, "{$name} not found"); } } $this->assertFalse(_did_wp_enqueue_script("prototype")); _reset_wp(); $pagenow = "post.php"; $this->adm->setup_admin_menu(); $this->assertFalse(_did_wp_enqueue_script("prototype")); _reset_wp(); $_REQUEST['action'] = "edit"; $this->adm->setup_admin_menu(); $this->assertTrue(_did_wp_enqueue_script("prototype")); _reset_wp(); $pagenow = ""; $_REQUEST['action'] = ""; $plugin_page = realpath(dirname(__FILE__) . '/../classes/ComicPressManagerAdmin.php'); $this->adm->setup_admin_menu(); $this->assertTrue(_did_wp_enqueue_script("prototype")); }
function setUp() { _reset_wp(); $this->w = new ComicPressArchiveDropdownWidget(); }
function setUp() { _reset_wp(); $this->p = new ComicPressComicPost(); }
function setUp() { _reset_wp(); $this->rp = new ComicPressRelatedPosts(); }
function setUp() { _reset_wp(); _set_user_capabilities('submit_transcriptions', 'approve_transcriptions', 'change_languages'); }
function setUp() { _reset_wp(); $this->fa = new ComicPressBackendURLFactory(); }
function setUp() { _reset_wp(); $this->nav = new ComicPressNavigation(); }
function setUp() { _reset_wp(); $_SERVER = array(); }
function setUp() { _reset_wp(); $this->css = new ComicPressStoryline(); }
function setUp() { _reset_wp(); wp_insert_post((object) array('ID' => 1)); $this->to = new WDTSTranscriptOptions(1); }
function setUp() { $this->pw = new PluginWonderful(); $_POST = array(); _reset_wp(); }
function setUp() { _reset_wp(); $this->w = new ComicPressBuyPrintWidget('id', 'name', array()); }
function setUp() { global $wp_query; _reset_wp(); unset($wp_query); }
function setUp() { _reset_wp(); $_POST = array(); $this->core = new ComicPressAddonCore(); }