PHP 클래스 Phergie_Plugin_TestCase, phergie

저자: Phergie Development Team ([email protected])
상속: extends PHPUnit_Framework_TestCase
파일 보기 프로젝트 열기: phergie/phergie 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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

공개 메소드들

메소드 설명
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.

보호된 메소드들

메소드 설명
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().

메소드 상세

assertDoesNotEmitEvent() 보호된 메소드

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.
protected assertDoesNotEmitEvent ( string $type, array $args = [] ) : void
$type string Event type
$args array Optional enumerated array of event arguments
리턴 void

assertEmitsEvent() 보호된 메소드

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.
protected assertEmitsEvent ( string $type, array $args = [] ) : void
$type string Event type
$args array Optional enumerated array of event arguments
리턴 void

assertRemovesPlugin() 공개 메소드

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.
public assertRemovesPlugin ( string | Phergie_Plugin_Abstract | array $plugin ) : void
$plugin string | Phergie_Plugin_Abstract | array Short name of the plugin or the plugin instance to be removed or an array of multiple instances of either
리턴 void

assertRequiresPlugin() 공개 메소드

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().
public assertRequiresPlugin ( string | array $name ) : void
$name string | array Short name of the plugin required as a dependency or an array containing multiple instances thereof
리턴 void

getMockDatabase() 공개 메소드

Creates an in-memory copy of a specified SQLite database file and returns a connection to it.
public getMockDatabase ( string $path ) : PDO
$path string Path to the SQLite file to copy
리턴 PDO Connection to the database copy

getPluginsPath() 보호된 메소드

Returns the absolute path to the Phergie/Plugin directory. Useful in conjunction with getMockDatabase().
protected getPluginsPath ( string $subpath = null ) : string
$subpath string Optional path to append to the directory path
리턴 string Directory path

removePlugin() 공개 메소드

Records an actual plugin removal.
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
리턴 void

requirePlugin() 공개 메소드

Records an actual plugin requirement.
public requirePlugin ( string $name ) : Phergie_Plugin_Abstract
$name string Short name of the plugin required as a dependency
리턴 Phergie_Plugin_Abstract Mock instance of the specified plugin

setUp() 공개 메소드

Initializes instance properties.
public setUp ( ) : void
리턴 void

tearDown() 공개 메소드

Destroys all initialized instance properties.
public tearDown ( ) : void
리턴 void

프로퍼티 상세

$plugin 보호되어 있는 프로퍼티

Plugin instance being tested
protected Phergie_Plugin_Abstract $plugin
리턴 Phergie_Plugin_Abstract

$pluginClass 보호되어 있는 프로퍼티

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
protected string $pluginClass
리턴 string