|
@@ 916-925 (lines=10) @@
|
| 913 |
|
* |
| 914 |
|
* @since 5.5.0 |
| 915 |
|
*/ |
| 916 |
|
public function test_fetch_nonexistent_widget_data() { |
| 917 |
|
jetpack_register_widget_milestone(); |
| 918 |
|
|
| 919 |
|
$response = $this->create_and_get_request( 'widgets/some_other_slug-133', array(), 'GET' ); |
| 920 |
|
|
| 921 |
|
// Fails because there is no such widget |
| 922 |
|
$this->assertResponseStatus( 404, $response ); |
| 923 |
|
|
| 924 |
|
unregister_widget( 'Milestone_Widget' ); |
| 925 |
|
} |
| 926 |
|
|
| 927 |
|
/** |
| 928 |
|
* Test fetching a nonexistent instance of an existing widget. |
|
@@ 932-941 (lines=10) @@
|
| 929 |
|
* |
| 930 |
|
* @since 5.5.0 |
| 931 |
|
*/ |
| 932 |
|
public function test_fetch_nonexistent_widget_instance_data() { |
| 933 |
|
jetpack_register_widget_milestone(); |
| 934 |
|
|
| 935 |
|
$response = $this->create_and_get_request( 'widgets/milestone_widget-333', array(), 'GET' ); |
| 936 |
|
|
| 937 |
|
// Fails because there is no such widget instance |
| 938 |
|
$this->assertResponseStatus( 404, $response ); |
| 939 |
|
|
| 940 |
|
unregister_widget( 'Milestone_Widget' ); |
| 941 |
|
} |
| 942 |
|
|
| 943 |
|
/** |
| 944 |
|
* Test fetching a widget that exists but has not been registered. |