Phergie_Plugin_TestCase::setUp PHP Method

setUp() public method

Initializes instance properties.
public setUp ( ) : void
return void
    public function setUp()
    {
        if (empty($this->pluginClass)) {
            $this->pluginClass = preg_replace('/Test$/', '', get_class($this));
        }
        if (empty($this->plugin)) {
            $this->plugin = new $this->pluginClass();
        }
        $this->plugin->setConfig($this->getMockConfig());
        $this->plugin->setConnection($this->getMockConnection());
        $this->plugin->setEventHandler($this->getMockEventHandler());
        $plugins = $this->getMockPluginHandler();
        $plugins->expects($this->any())->method('getPlugin')->will($this->returnCallback(array($this, 'requirePlugin')));
        $plugins->expects($this->any())->method('removePlugin')->will($this->returnCallback(array($this, 'removePlugin')));
        $this->plugin->setPluginHandler($plugins);
        $this->mockPlugins = array();
        $this->expectedRequiredPlugins = array();
        $this->actualRequiredPlugins = array();
        $this->expectedRemovedPlugins = array();
        $this->actualRemovedPlugins = array();
    }

Usage Example

Beispiel #1
0
 /**
  * Checks for the pspell extension.
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     if (!extension_loaded('pspell')) {
         $this->markTestSkipped('pspell extension not available');
     }
 }
All Usage Examples Of Phergie_Plugin_TestCase::setUp