Skip to content
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

Merged
merged 4 commits into from Aug 15, 2018

Conversation

rajanvijayan
Copy link
Contributor

@rajanvijayan rajanvijayan commented Jul 30, 2018

Fix #350

Blocked by #247

@ghost ghost assigned rajanvijayan Jul 30, 2018
@ghost ghost added the In Progress Workflow Label: Current in progress label Jul 30, 2018
@rajanvijayan rajanvijayan requested a review from sudar July 31, 2018 00:37
@rajanvijayan rajanvijayan assigned sudar and unassigned rajanvijayan Jul 31, 2018
@rajanvijayan
Copy link
Contributor Author

@sudar development finished ready to review

@sudar sudar assigned rajanvijayan and sudar and unassigned sudar and rajanvijayan Aug 2, 2018
/**
* Add to test delete default taxonomy term meta with equal value.
*/
public function test_that_delete_default_taxonomy_term_meta_with_equal_value() {
Copy link
Owner

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.

Copy link
Contributor Author

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 );
Copy link
Owner

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@sudar sudar assigned rajanvijayan and unassigned sudar Aug 10, 2018
Add explicit checks
Fix #350
@rajanvijayan rajanvijayan assigned sudar and unassigned rajanvijayan Aug 12, 2018
@rajanvijayan
Copy link
Contributor Author

@sudar Its ready to review

// Assert that post meta deleted.
$this->assertEquals( 1, $meta_deleted );

$meta = get_term_meta( $term_array['term_id'], 'another' );
Copy link
Owner

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@sudar sudar assigned rajanvijayan and unassigned sudar Aug 12, 2018
@rajanvijayan
Copy link
Contributor Author

@sudar its ready to review

@rajanvijayan rajanvijayan assigned sudar and rajanvijayan and unassigned rajanvijayan and sudar Aug 13, 2018
@rajanvijayan rajanvijayan merged commit 84dfe83 into 247-fix/delete-term-meta Aug 15, 2018
@ghost ghost removed the In Progress Workflow Label: Current in progress label Aug 15, 2018
@rajanvijayan rajanvijayan deleted the 350-fix/delete-term-meta-test branch August 15, 2018 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants