-
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 Plugin Context class provides helper methods to return additional information about the Plugin Check plugin. This includes information such as the basename, paths and URLs of the Plugin Check plugin.
This allows checks to use this information when preparing or performing tests. For example, a check may want to create test content before running tests. This test content may be stored as a file within the Plugin Check plugin, which can be easily referenced using the methods and data stored in the Plugin_Context class.
Plugin_Context class will be instantiated in the Plugin_Main class constructor and use the main file passed which will be the absolute path of the Plugin Check plugin’s main file.
Acceptance Criteria
- The class file
Plugin_Context.phpexists withinincludes $main_fileas the plugin's main file should be a protected property- Constructor should receive the plugin's main file as a parameter and assign it to
$main_file basename()method should return the plugin's name usingplugin_basenamepath()method should return the absolute path of the plugin dir usingplugin_dir_pathurl()method should return the plugin's URL usingplugin_dir_url- PHPUnit tests covering
basename()method returns string and name of the pluginpath()method returns string and path of the pluginurl()method returns string and URL of the plugin
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