Skip to content

Commit

Permalink
remove unused tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanrajpac committed Feb 11, 2024
1 parent 951a121 commit 1cc8322
Showing 1 changed file with 1 addition and 47 deletions.
48 changes: 1 addition & 47 deletions tests/units/FlagsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,51 +37,5 @@ public function test_get_all_flags_method_should_return_multiple_flags_from_opti
$result = $flags->get_all_flags();
$this->assertEquals($result, $mock_option_value);
}

public function test_post_flags_methods_should_return_success_if_input_is_array() {
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
$request_mock = \Mockery::mock('WP_Request');
$request_mock->shouldReceive('get_json_params')->andReturn(['param1' => 'value1']);

\Brain\Monkey\Functions\when('update_option')->justReturn(true);
\Brain\Monkey\Functions\when('rest_ensure_response')->returnArg();

global $wp;
$wp = new \stdClass();
$wp->request = $request_mock;

$flags = new Flags();
$result = $flags->post_flags($request_mock);

$this->assertEquals(['status'=>200, 'success' => true], $result);

unset($GLOBALS['wp']);
}

public function test_post_flags_methods_should_throw_error_if_input_is_not_an_array() {
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
$request_mock = \Mockery::mock('WP_Request');
$request_mock->shouldReceive('get_json_params')->andReturn('test');

global $wp;
$wp = new \stdClass();
$wp->request = $request_mock;

$error_mock = \Mockery::mock('WP_Error');

\Brain\Monkey\Functions\expect('post_flags')->andReturn($error_mock);


$flags = new Flags();
$result = $flags->post_flags($request_mock);

$this->assertInstanceOf('WP_Error', $result);

}



}

0 comments on commit 1cc8322

Please sign in to comment.