Changeset 39038 for trunk/tests/phpunit/tests/ajax/CustomizeMenus.php
- Timestamp:
- 10/30/2016 08:20:54 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/ajax/CustomizeMenus.php
r38436 r39038 548 548 $this->assertArrayHasKey( 'post_id', $response['data'] ); 549 549 $this->assertArrayHasKey( 'url', $response['data'] ); 550 $post = get_post( $response['data']['post_id'] ); 551 $this->assertEquals( 'Hello World', $post->post_title ); 552 $this->assertEquals( 'post', $post->post_type ); 553 $this->assertEquals( 'hello-world', $post->post_name ); 550 554 } 551 555 … … 636 640 $this->assertFalse( $response['success'] ); 637 641 $this->assertEquals( 'missing_post_title', $response['data'] ); 642 643 // illegal_params. 644 $_POST = wp_slash( array( 645 'customize-menus-nonce' => wp_create_nonce( 'customize-menus' ), 646 'params' => array( 647 'post_type' => 'post', 648 'post_title' => 'OK', 649 'post_name' => 'bad', 650 'post_content' => 'bad', 651 ), 652 ) ); 653 $this->_last_response = ''; 654 $this->make_ajax_call( 'customize-nav-menus-insert-auto-draft' ); 655 $response = json_decode( $this->_last_response, true ); 656 $this->assertFalse( $response['success'] ); 657 $this->assertEquals( 'illegal_params', $response['data'] ); 638 658 } 639 659 }
Note: See TracChangeset
for help on using the changeset viewer.