Esempio n. 1
0
 /**
  * Check if a shell class exists for the given name.
  *
  * @param string $shell The shell name to look for.
  * @return string|bool Either the classname or false.
  */
 protected function _shellExists($shell)
 {
     $text = new Text($shell);
     $shell = $text->camelize();
     $class = __NAMESPACE__ . "\\Shell\\{$shell}Shell";
     if (class_exists($class)) {
         return $class;
     }
     return false;
 }
Esempio n. 2
0
 /**
  * Demonstrate the expected output for bad inputs
  *
  * @return void
  */
 public function testCamelize()
 {
     $text = new Text('test_thing');
     $this->assertSame('TestThing', $text->camelize());
     $text = new Text('test-thing');
     $this->assertSame('Test-thing', $text->camelize());
     $text = new Text('test thing');
     $this->assertSame('TestThing', $text->camelize());
     $text = new Text('test_thing');
     $this->assertSame('Test_thing', $text->camelize('-'));
     $text = new Text('test-thing');
     $this->assertSame('TestThing', $text->camelize('-'));
     $text = new Text('test thing');
     $this->assertSame('TestThing', $text->camelize('-'));
     $text = new Text('test_thing');
     $this->assertSame('Test_thing', $text->camelize(' '));
     $text = new Text('test-thing');
     $this->assertSame('Test-thing', $text->camelize(' '));
     $text = new Text('test thing');
     $this->assertSame('TestThing', $text->camelize(' '));
     $text = new Text('TestPlugin.TestPluginComments');
     $this->assertSame('TestPlugin.TestPluginComments', $text->camelize());
 }