/** * @ticket 21117 */ function test_content_post_type() { register_post_type('content', array('show_in_admin_bar' => true)); $admin_bar = new WP_Admin_Bar(); wp_admin_bar_new_content_menu($admin_bar); $nodes = $admin_bar->get_nodes(); $this->assertFalse($nodes['new-content']->parent); $this->assertEquals('new-content', $nodes['add-new-content']->parent); _unregister_post_type('content'); }
/** * @ticket 21117 */ function test_content_post_type() { wp_set_current_user($this->factory->user->create(array('role' => 'editor'))); register_post_type('content', array('show_in_admin_bar' => true)); $admin_bar = new WP_Admin_Bar(); wp_admin_bar_new_content_menu($admin_bar); $nodes = $admin_bar->get_nodes(); $this->assertFalse($nodes['new-content']->parent); $this->assertEquals('new-content', $nodes['add-new-content']->parent); _unregister_post_type('content'); }