Skip to content

Commit

Permalink
Update REST API Controller PHPUnit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka committed Apr 27, 2023
1 parent 3fc8957 commit ce3eba0
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 72 deletions.
56 changes: 32 additions & 24 deletions phpunit/class-gutenberg-rest-templates-controller-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,35 +62,43 @@ public function test_get_template_fallback() {
$this->assertSame( 'index', $response->get_data()['slug'], 'Should fallback to `index.html`.' );
}

public function test_context_param() {
$this->markTestIncomplete();
}
/**
* @doesNotPerformAssertions
*/
public function test_context_param() {}

public function test_get_items() {
$this->markTestIncomplete();
}
/**
* @doesNotPerformAssertions
*/
public function test_get_items() {}

public function test_get_item() {
$this->markTestIncomplete();
}
/**
* @doesNotPerformAssertions
*/
public function test_get_item() {}

public function test_create_item() {
$this->markTestIncomplete();
}
/**
* @doesNotPerformAssertions
*/
public function test_create_item() {}

public function test_update_item() {
$this->markTestIncomplete();
}
/**
* @doesNotPerformAssertions
*/
public function test_update_item() {}

public function test_delete_item() {
$this->markTestIncomplete();
}
/**
* @doesNotPerformAssertions
*/
public function test_delete_item() {}

public function test_prepare_item() {
$this->markTestIncomplete();
}
/**
* @doesNotPerformAssertions
*/
public function test_prepare_item() {}

public function test_get_item_schema() {
$this->markTestIncomplete();
}
/**
* @doesNotPerformAssertions
*/
public function test_get_item_schema() {}
}
48 changes: 27 additions & 21 deletions phpunit/class-wp-rest-block-pattern-categories-controller-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,32 +80,38 @@ public function test_get_items() {

/**
* Abstract methods that we must implement.
*
* @doesNotPerformAssertions
*/
public function test_context_param() {
$this->markTestIncomplete();
}
public function test_context_param() {}

public function test_get_item() {
$this->markTestIncomplete();
}
/**
* @doesNotPerformAssertions
*/
public function test_get_item() {}

public function test_create_item() {
$this->markTestIncomplete();
}
/**
* @doesNotPerformAssertions
*/
public function test_create_item() {}

public function test_update_item() {
$this->markTestIncomplete();
}
/**
* @doesNotPerformAssertions
*/
public function test_update_item() {}

public function test_delete_item() {
$this->markTestIncomplete();
}
/**
* @doesNotPerformAssertions
*/
public function test_delete_item() {}

public function test_prepare_item() {
$this->markTestIncomplete();
}
/**
* @doesNotPerformAssertions
*/
public function test_prepare_item() {}

public function test_get_item_schema() {
$this->markTestIncomplete();
}
/**
* @doesNotPerformAssertions
*/
public function test_get_item_schema() {}
}
70 changes: 43 additions & 27 deletions phpunit/class-wp-test-rest-users-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,34 +156,50 @@ public function set_up() {
/**
* The following methods are implemented in core and tested.
* We need to define them here because they exist in the abstract parent.
*
* @doesNotPerformAssertions
*/
public function test_register_routes() {
$this->markTestIncomplete();
}
public function test_context_param() {
$this->markTestIncomplete();
}
public function test_get_item() {
$this->markTestIncomplete();
}
public function test_prepare_item() {
$this->markTestIncomplete();
}
public function test_create_item() {
$this->markTestIncomplete();
}
public function test_update_item() {
$this->markTestIncomplete();
}
public function test_delete_item() {
$this->markTestIncomplete();
}
public function test_get_items() {
$this->markTestIncomplete();
}
public function test_get_item_schema() {
$this->markTestIncomplete();
}
public function test_register_routes() {}

/**
* @doesNotPerformAssertions
*/
public function test_context_param() {}

/**
* @doesNotPerformAssertions
*/
public function test_get_item() {}

/**
* @doesNotPerformAssertions
*/
public function test_prepare_item() {}

/**
* @doesNotPerformAssertions
*/
public function test_create_item() {}

/**
* @doesNotPerformAssertions
*/
public function test_update_item() {}

/**
* @doesNotPerformAssertions
*/
public function test_delete_item() {}

/**
* @doesNotPerformAssertions
*/
public function test_get_items() {}

/**
* @doesNotPerformAssertions
*/
public function test_get_item_schema() {}

public function test_registered_query_params() {
$request = new WP_REST_Request( 'OPTIONS', '/wp/v2/users' );
Expand Down

0 comments on commit ce3eba0

Please sign in to comment.