Skip to content

Commit

Permalink
Remove tests
Browse files Browse the repository at this point in the history
  • Loading branch information
spacedmonkey committed Sep 9, 2021
1 parent b5f6a3e commit a9481ce
Showing 1 changed file with 0 additions and 90 deletions.
90 changes: 0 additions & 90 deletions phpunit/class-rest-nav-menu-items-controller-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,59 +271,6 @@ public function test_create_item_invalid_term() {
$this->assertErrorResponse( 'rest_term_invalid_id', $response, 400 );
}

/**
*
*/
public function test_create_item_change_position() {
wp_set_current_user( self::$admin_id );
$new_menu_id = wp_create_nav_menu( rand_str() );
for ( $i = 1; $i < 5; $i ++ ) {
$request = new WP_REST_Request( 'POST', '/__experimental/menu-items' );
$request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
$params = $this->set_menu_item_data(
array(
'menus' => $new_menu_id,
)
);
$request->set_body_params( $params );
$response = rest_get_server()->dispatch( $request );
$this->check_create_menu_item_response( $response );
$data = $response->get_data();
$this->assertEquals( $data['menu_order'], $i );
}
}

/**
*
*/
public function test_create_item_invalid_position() {
wp_set_current_user( self::$admin_id );
$new_menu_id = wp_create_nav_menu( rand_str() );
$request = new WP_REST_Request( 'POST', '/__experimental/menu-items' );
$request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
$params = $this->set_menu_item_data(
array(
'menu_order' => 1,
'menus' => $new_menu_id,
)
);
$request->set_body_params( $params );
$response = rest_get_server()->dispatch( $request );
$this->check_create_menu_item_response( $response );
$request = new WP_REST_Request( 'POST', '/__experimental/menu-items' );
$request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
$params = $this->set_menu_item_data(
array(
'menu_order' => 1,
'menus' => $new_menu_id,
)
);
$request->set_body_params( $params );
$response = rest_get_server()->dispatch( $request );

$this->assertErrorResponse( 'invalid_menu_order', $response, 400 );
}

/**
*
*/
Expand Down Expand Up @@ -380,43 +327,6 @@ public function test_create_item_invalid_parent() {
$this->assertErrorResponse( 'rest_invalid_param', $response, 400 );
}

/**
*
*/
public function test_create_item_invalid_parent_menu_item() {
wp_set_current_user( self::$admin_id );
$new_menu_id = wp_create_nav_menu( rand_str() );
$request = new WP_REST_Request( 'POST', '/__experimental/menu-items' );
$request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
$params = $this->set_menu_item_data(
array(
'menus' => $new_menu_id,
'parent' => $this->menu_item_id,
)
);
$request->set_body_params( $params );
$response = rest_get_server()->dispatch( $request );
$this->assertErrorResponse( 'invalid_item_parent', $response, 400 );
}

/**
*
*/
public function test_create_item_invalid_parent_post() {
wp_set_current_user( self::$admin_id );
$post_id = self::factory()->post->create();
$request = new WP_REST_Request( 'POST', '/__experimental/menu-items' );
$request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
$params = $this->set_menu_item_data(
array(
'parent' => $post_id,
)
);
$request->set_body_params( $params );
$response = rest_get_server()->dispatch( $request );
$this->assertErrorResponse( 'invalid_menu_item_parent', $response, 400 );
}

/**
*
*/
Expand Down

0 comments on commit a9481ce

Please sign in to comment.