/**
  * Verify loading of (plugin-) shells
  *
  * @return void
  */
 public function testGetShell()
 {
     $this->skipIf(class_exists('SampleShell'), 'SampleShell Class already loaded.');
     $this->skipIf(class_exists('ExampleShell'), 'ExampleShell Class already loaded.');
     $Dispatcher = new TestShellDispatcher();
     $result = $Dispatcher->getShell('sample');
     $this->assertInstanceOf('SampleShell', $result);
     $Dispatcher = new TestShellDispatcher();
     $result = $Dispatcher->getShell('test_plugin.example');
     $this->assertInstanceOf('ExampleShell', $result);
     $this->assertEquals('TestPlugin', $result->plugin);
     $this->assertEquals('Example', $result->name);
     $Dispatcher = new TestShellDispatcher();
     $result = $Dispatcher->getShell('TestPlugin.example');
     $this->assertInstanceOf('ExampleShell', $result);
 }
Exemple #2
0
 /**
  * Verify loading of (plugin-) shells
  *
  * @return void
  * @access public
  */
 function testGetShell()
 {
     $this->skipIf(class_exists('SampleShell'), '%s SampleShell Class already loaded');
     $this->skipIf(class_exists('ExampleShell'), '%s ExampleShell Class already loaded');
     $Dispatcher = new TestShellDispatcher();
     $Dispatcher->shell = 'sample';
     $Dispatcher->shellName = 'Sample';
     $Dispatcher->shellClass = 'SampleShell';
     $result = $Dispatcher->getShell();
     $this->assertIsA($result, 'SampleShell');
     $Dispatcher = new TestShellDispatcher();
     $Dispatcher->shell = 'example';
     $Dispatcher->shellName = 'Example';
     $Dispatcher->shellClass = 'ExampleShell';
     $result = $Dispatcher->getShell('test_plugin');
     $this->assertIsA($result, 'ExampleShell');
 }