PHP Class Phergie_TestCase, phergie

Author: Phergie Development Team ([email protected])
Inheritance: extends PHPUnit_Framework_TestCase
Show file Open project: phergie/phergie Class Usage Examples

Protected Properties

Property Type Description
$config Phergie_Config Mock configuration
$connection Phergie_Connection Mock connection
$connections Phergie_Connection_Handler Mock connection handler
$events Phergie_Event_Handler Mock event handler
$nick string User nick used in any events requiring one
$plugins Phergie_Plugin_Handler Mock plugin handler
$processor Phergie_Process_Abstract Mock event processor
$settings array Associative array for configuration setting values, accessed by the mock configuration object using a callback
$source string Event source used in any events requiring one
$ui Phergie_Ui_Abstract Mock end-user interface

Public Methods

Method Description
configOffsetExists ( string $name ) : boolean Returns whether a specific configuration setting has a value. Only intended for use by this class, but must be public for PHPUnit to call them.
configOffsetGet ( string $name ) : mixed Returns the value of a specific configuration setting. Only intended for use by this class, but must be public for PHPUnit to call them.
tearDown ( ) : void Destroys all initialized instance properties.

Protected Methods

Method Description
getMockConfig ( ) : Phergie_Config Returns a mock configuration object.
getMockConnection ( ) : Phergie_Connection Returns a mock connection object.
getMockConnectionHandler ( ) : Phergie_Connection_Handler Returns a mock connection handler object.
getMockEvent ( array $args = [], string $nick = null, string $source = null ) : Phergie_Event_Request Returns a mock event object.
getMockEventHandler ( ) : Phergie_Event_Handler Returns a mock event handler object.
getMockPluginHandler ( ) : Phergie_Plugin_Handler Returns a mock plugin handler object.
getMockProcessor ( Phergie_Bot $bot ) : Phergie_Process_Abstract Returns a mock event processor instance.
getMockUi ( ) : Phergie_Ui_Abstract Returns a mock end-user interface instance.
setConfig ( string $setting, mixed $value ) : void Sets the value of a configuration setting.

Method Details

configOffsetExists() public method

Returns whether a specific configuration setting has a value. Only intended for use by this class, but must be public for PHPUnit to call them.
public configOffsetExists ( string $name ) : boolean
$name string Name of the setting
return boolean TRUE if the setting has a value, FALSE otherwise

configOffsetGet() public method

Returns the value of a specific configuration setting. Only intended for use by this class, but must be public for PHPUnit to call them.
public configOffsetGet ( string $name ) : mixed
$name string Name of the setting
return mixed Value of the setting

getMockConfig() protected method

Returns a mock configuration object.
protected getMockConfig ( ) : Phergie_Config
return Phergie_Config

getMockConnection() protected method

Returns a mock connection object.
protected getMockConnection ( ) : Phergie_Connection
return Phergie_Connection

getMockConnectionHandler() protected method

Returns a mock connection handler object.
protected getMockConnectionHandler ( ) : Phergie_Connection_Handler
return Phergie_Connection_Handler

getMockEvent() protected method

Returns a mock event object.
protected getMockEvent ( array $args = [], string $nick = null, string $source = null ) : Phergie_Event_Request
$args array Optional associative array of event arguments
$nick string Optional user nick to associate with the event
$source string Optional user nick or channel name to associate with the event as its source
return Phergie_Event_Request

getMockEventHandler() protected method

Returns a mock event handler object.
protected getMockEventHandler ( ) : Phergie_Event_Handler
return Phergie_Event_Handler

getMockPluginHandler() protected method

Returns a mock plugin handler object.
protected getMockPluginHandler ( ) : Phergie_Plugin_Handler
return Phergie_Plugin_Handler

getMockProcessor() protected method

Returns a mock event processor instance.
protected getMockProcessor ( Phergie_Bot $bot ) : Phergie_Process_Abstract
$bot Phergie_Bot Bot instance for which events are to be processed
return Phergie_Process_Abstract

getMockUi() protected method

Returns a mock end-user interface instance.
protected getMockUi ( ) : Phergie_Ui_Abstract
return Phergie_Ui_Abstract

setConfig() protected method

Sets the value of a configuration setting.
protected setConfig ( string $setting, mixed $value ) : void
$setting string Name of the setting
$value mixed Value for the setting
return void

tearDown() public method

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

Property Details

$config protected property

Mock configuration
protected Phergie_Config $config
return Phergie_Config

$connection protected property

Mock connection
protected Phergie_Connection $connection
return Phergie_Connection

$connections protected property

Mock connection handler
protected Phergie_Connection_Handler $connections
return Phergie_Connection_Handler

$events protected property

Mock event handler
protected Phergie_Event_Handler $events
return Phergie_Event_Handler

$nick protected property

User nick used in any events requiring one
protected string $nick
return string

$plugins protected property

Mock plugin handler
protected Phergie_Plugin_Handler $plugins
return Phergie_Plugin_Handler

$processor protected property

Mock event processor
protected Phergie_Process_Abstract $processor
return Phergie_Process_Abstract

$settings protected property

Associative array for configuration setting values, accessed by the mock configuration object using a callback
protected array $settings
return array

$source protected property

Event source used in any events requiring one
protected string $source
return string

$ui protected property

Mock end-user interface
protected Phergie_Ui_Abstract $ui
return Phergie_Ui_Abstract