-
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
The CLI runner class will implement the Abstract_Check_Runner and its methods to use Checks class to run checks for a plugin provided. CLI command class will invoke or use the instance of the CLI Runner class to use the methods of the Checks class to run the checks.
This issue is dependant on:
Acceptance Criteria
- Class
CLI_Runnershould be created and exists atincludes/Checker - The
CLI_Runnerclass extends theAbstract_Check_Runner - The class contains a
is_plugin_check()method.- The
is_plugin_check()method accepts no parameters. - The
is_plugin_check()method will use the global$_REQUEST['argv']array, and any other relevant data, to determine if the current request is for the Plugin Checker via the CLI by:- Checking the
$_REQUEST['argv']contains thewp plugin checkcommand (see Create the WP-CLI subcommand wp plugin check #30)
- Checking the
- If the above conditions are correct, the method returns
true - If the above conditions do not match, the method returns
false.
- The
- The class contains a protected
setup_checks()method.- The
setup_checks()method accepts no parameters. - The
setup_checks()method will pass the plugin name from the$_REQUEST['argv']to theChecksconstructor and assign the object to the$checksproperty. - The
setup_checks()method will check the$_REQUEST['argv']array of slugs for the checks to run. If this does not exist all checks will be run from theChecksget_checks()method. - The Check instances retrieved from the
Checksclass instanceget_checks()and assigned to the$checks_to_runproperty.
- The
- The class contains a
run()method.- The
run()method accepts no parameters. - The
run()method will call theChecksclassrun_checks()method passing the$checks_to_runproperty. ($this->checks->run_checks( $this->checks_to_run )) - The
run()method will return the instance ofCheck_Resultsreturned by therun_checks()method.
- The
Test Coverage
- Test
is_plugin_check()returnstruewhen the$_REQUEST['argv']array contains the expected values for a Plugin Checker CLI request. - Test
is_plugin_check()returnsfalsewhen the$_REQUEST['argv']array does not contains the expected values for a Plugin Checker CLI request. - The
requires_universal_preperationsreturns false when no Checks passed implements theRuntime_Checkinterface - The
requires_universal_preperationsreturns true when one or more Checks passed implements theRuntime_Checkinterface - Test
prepare()method returnsnullwhen the checks to run does not contain aCheckthat implements theRuntime_Checkinterface. - Test
prepare()method returns acallablecleanup function when the checks to run contains aCheckthat implements theRuntime_Checkinterface. - Test
run()method returns an instance ofCheck_Results. - Test
Check_Resultsreturned byrun()contains no errors/warnings when running the testEmpty_Check - Test
Check_Resultsreturned byrun()contains errors when running the testError_Check
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