Property | Type | Description | |
---|---|---|---|
$plugin | Phergie_Plugin_Abstract | Plugin instance being tested | |
$pluginClass | string | Full name of the plugin class being tested, may be explicitly specified in subclasses but is otherwise automatically derived from the test case class name |
Method | Description | |
---|---|---|
assertRemovesPlugin ( string | Phergie_Plugin_Abstract | array $plugin ) : void | Modifies the plugin handler to include an expectation of a plugin being removed. Note that this must be called BEFORE executing the plugin code that may remove that plugin. | |
assertRequiresPlugin ( string | array $name ) : void | Modifies the plugin handler to include an expectation of a plugin being retrieved, indicating a dependency. Note that this must be called BEFORE executing the plugin code that may load that plugin dependency, which is usually located in onLoad(). | |
getMockDatabase ( string $path ) : PDO | Creates an in-memory copy of a specified SQLite database file and returns a connection to it. | |
removePlugin ( string | Phergie_Plugin_Abstract $plugin ) : void | Records an actual plugin removal. | |
requirePlugin ( string $name ) : Phergie_Plugin_Abstract | Records an actual plugin requirement. | |
setUp ( ) : void | Initializes instance properties. | |
tearDown ( ) : void | Destroys all initialized instance properties. |
Method | Description | |
---|---|---|
assertDoesNotEmitEvent ( string $type, array $args = [] ) : void | Modifies the event handler to include an expectation of an event NOT being added by the plugin being tested. Note that this must be called BEFORE executing plugin code that may initiate the event. | |
assertEmitsEvent ( string $type, array $args = [] ) : void | Modifies the event handler to include an expectation of an event being added by the plugin being tested. Note that this must be called BEFORE executing the plugin code intended to initiate the event. | |
getPluginsPath ( string $subpath = null ) : string | Returns the absolute path to the Phergie/Plugin directory. Useful in conjunction with getMockDatabase(). |
public getMockDatabase ( string $path ) : PDO | ||
$path | string | Path to the SQLite file to copy |
return | PDO | Connection to the database copy |
protected getPluginsPath ( string $subpath = null ) : string | ||
$subpath | string | Optional path to append to the directory path |
return | string | Directory path |
public removePlugin ( string | Phergie_Plugin_Abstract $plugin ) : void | ||
$plugin | string | Phergie_Plugin_Abstract | Short name of the plugin or the plugin instance to be removed |
return | void |
public requirePlugin ( string $name ) : Phergie_Plugin_Abstract | ||
$name | string | Short name of the plugin required as a dependency |
return | Phergie_Plugin_Abstract | Mock instance of the specified plugin |
protected Phergie_Plugin_Abstract $plugin | ||
return | Phergie_Plugin_Abstract |
protected string $pluginClass | ||
return | string |