Skip to content

Commit

Permalink
Mock new endpoint for deactivating licenses on tests for WPJM Helper API
Browse files Browse the repository at this point in the history
  • Loading branch information
fjorgemota committed Sep 22, 2023
1 parent 89c8162 commit aced50f
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,8 @@ public function test_activate_invalid() {
*/
public function test_deactivate_valid() {
$base_args = $this->get_base_args();
$this->set_expected_response(
[
'args' => wp_parse_args(
[
'wc-api' => 'wp_plugin_licencing_activation_api',
'request' => 'deactivate',
],
$base_args
),
]
$this->mock_http_request( '/wp-json/wpjmcom-licensing/v1/deactivate',
$this->default_valid_response()
);
$instance = new WP_Job_Manager_Helper_API();
$response = $instance->deactivate( $base_args );
Expand All @@ -151,6 +143,12 @@ public function test_deactivate_valid() {
*/
public function test_deactivate_invalid() {
$base_args = $this->get_base_args();
$this->mock_http_request( '/wp-json/wpjmcom-licensing/v1/deactivate',
[
'error_code' => 'license_not_found'
],
404
);
$instance = new WP_Job_Manager_Helper_API();
$response = $instance->deactivate( $base_args );

Expand Down

0 comments on commit aced50f

Please sign in to comment.