Skip to content

Create a Universal_Runtime_Preparation #61

@jjgrainger

Description

@jjgrainger

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.

Metadata

Metadata

Labels

InfrastructureIssues for the overall plugin infrastructure[Type] EnhancementA suggestion for improvement of an existing feature

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions