Description
Create a Universal_Runtime_Preparation to handle all preparations required for when at least one Runtime_Check is being run.
This Preparation depends on the following issues and should be started once they are complete.
Acceptance Criteria
- Class
Universal_Runtime_Preparation should be created and exists at includes/Checker/Preparations/Universal_Runtime_Preparation.php.
- Class
Universal_Runtime_Preparation should extend Preparation interface.
- Class has a protected
$check_context property.
- Class constructor accepts an instance of the
Check_Context and assigns it to the $check_context property.
- Class contains a
prepare() method that accepts no parameters and will do the following:
- Instantiate the
Use_Minimal_Theme_Preparation to use the wp-empty-theme in the Plugin Checker.
- Instantiate the
Force_Single_Plugin_Preparation to activate the plugin being checked.
- Runs the
prepare() method on the instances of both Use_Minimal_Theme_Preparation and Force_Single_Plugin_Preparation
- Returns a cleanup function that loops over the cleanup functions returned by both the
Use_Minimal_Theme_Preparation and Force_Single_Plugin_Preparation prepare methods.
Test Coverage
- Test the
prepare method returns a callable cleanup function.
- Test that
Use_Minimal_Theme_Preparation was successfully prepared by testing get_option( 'template' ) returns wp-empty-theme slug.
- Test that
Force_Single_Plugin_Preparation was successfully prepared by testing get_option( 'active_plugins' ) returns the plugins basename.
Description
Create a
Universal_Runtime_Preparationto handle all preparations required for when at least oneRuntime_Checkis being run.This Preparation depends on the following issues and should be started once they are complete.
Acceptance Criteria
Universal_Runtime_Preparationshould be created and exists atincludes/Checker/Preparations/Universal_Runtime_Preparation.php.Universal_Runtime_Preparationshould extendPreparationinterface.$check_contextproperty.Check_Contextand assigns it to the$check_contextproperty.prepare()method that accepts no parameters and will do the following:Use_Minimal_Theme_Preparationto use thewp-empty-themein the Plugin Checker.Force_Single_Plugin_Preparationto activate the plugin being checked.prepare()method on the instances of bothUse_Minimal_Theme_PreparationandForce_Single_Plugin_PreparationUse_Minimal_Theme_PreparationandForce_Single_Plugin_Preparationprepare methods.Test Coverage
preparemethod returns a callable cleanup function.Use_Minimal_Theme_Preparationwas successfully prepared by testingget_option( 'template' )returnswp-empty-themeslug.Force_Single_Plugin_Preparationwas successfully prepared by testingget_option( 'active_plugins' )returns the plugins basename.