-
Notifications
You must be signed in to change notification settings - Fork 83
Closed
Labels
InfrastructureIssues for the overall plugin infrastructureIssues for the overall plugin infrastructure[Type] EnhancementA suggestion for improvement of an existing featureA suggestion for improvement of an existing feature
Milestone
Description
Description
Demo post creation preparation will ensure that the plugin being checked is provided with all the necessary posts it needs to conduct the audit.
Acceptance Criteria
- Class
Demo_Posts_Creation_Preparationshould be created and exists atincludes/Checker/Preparations - Class
Demo_Posts_Creation_Preparationshould extendPreparationinterface - Class
Demo_Posts_Creation_Preparationhas a constructor.- The constructor accepts a
$postsparameter - The
$postsparameter passed will be an array of posts data. Each item in the array will contain post data compatible with thewp_insert_post()function. - The post data passed will be assigned to a protected property to be used later.
- The constructor accepts a
prepare()must be implemented fromPreparationinterface- The method will loop over the post data array passed in the constructor and create each post using the
wp_insert_post()function. - For each post successfully created, the post ID returned will be stored in an array.
- The cleanup function returned will loop over the array of post IDs created and remove each post from the database.
- The method will loop over the post data array passed in the constructor and create each post using the
Tests Coverage
Demo_Posts_Creation_Preparationinstance expected to be implementing ofPreparationinterfaceprepare()method adds the passed posts to the database.- The cleanup function returned by
prepare()removes the posts from the database.
Metadata
Metadata
Assignees
Labels
InfrastructureIssues for the overall plugin infrastructureIssues for the overall plugin infrastructure[Type] EnhancementA suggestion for improvement of an existing featureA suggestion for improvement of an existing feature