New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test case for delete term meta module #453
Add test case for delete term meta module #453
Conversation
@sudar development finished ready to review |
/** | ||
* Add to test delete default taxonomy term meta with equal value. | ||
*/ | ||
public function test_that_delete_default_taxonomy_term_meta_with_equal_value() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function name is not following the test_that_something_can_be_deleted
format.
Change it for all the methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
'term_meta_option' => 'equal', | ||
); | ||
|
||
$meta_deleted = $this->module->delete( $delete_options ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need to add some terms that won't be deleted in the test cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Add explicit checks Fix #350
@sudar Its ready to review |
// Assert that post meta deleted. | ||
$this->assertEquals( 1, $meta_deleted ); | ||
|
||
$meta = get_term_meta( $term_array['term_id'], 'another' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In add_term_meta
you are using the value Another
and here you are checking for another
.
Make sure you store the value in a variable before accessing it.
This problem is happening in all test cases. Fix it in all places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@sudar its ready to review |
Fix #350
Blocked by #247