Skip to content

Commit

Permalink
Fix tests + rename test class
Browse files Browse the repository at this point in the history
  • Loading branch information
Miraeld committed Jun 28, 2024
1 parent ee9131d commit d8d2fd7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
32 changes: 16 additions & 16 deletions tests/Fixtures/inc/Engine/License/API/UserClient/getUserData.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@
$data = json_decode( $json );

return [
'testShouldReturnDataWhenSuccess' => [
'config' => [
'transient' => false,
'response' => [
'headers' => [],
'body' => $json,
'response' => [
'code' => 200,
],
'cookies' => [],
'filename' => '',
],
],
'expected' => $data,
],
'testShouldReturnFalseWhenWPError' => [
'config' => [
'transient' => false,
Expand Down Expand Up @@ -55,21 +70,6 @@
],
],
'expected' => $data,
],
'testShouldReturnDataWhenSuccess' => [
'config' => [
'transient' => false,
'response' => [
'headers' => [],
'body' => $json,
'response' => [
'code' => 200,
],
'cookies' => [],
'filename' => '',
],
],
'expected' => $data,
],
]
];

Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public function set_up() {

public function tear_down() {
delete_transient( 'wp_rocket_customer_data' );
delete_transient( 'wpr_user_information' );
remove_filter( 'pre_get_rocket_option_consumer_email', [ $this, 'set_consumer_email' ] );
remove_filter( 'pre_get_rocket_option_consumer_key', [ $this, 'set_consumer_key' ] );
remove_filter( 'pre_http_request', [ $this, 'set_response' ] );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @group License
*/
class GetPricingData extends TestCase {
class GetUserData extends TestCase {
use ApiTrait;

protected static $api_credentials_config_file = 'license.php';
Expand Down

0 comments on commit d8d2fd7

Please sign in to comment.