Example #1
0
 /**
  * @return bool
  */
 protected function isInstanceOf(GClass $controllerClass, $fqn)
 {
     return $controllerClass->getReflection()->isSubclassOf($fqn);
 }
Example #2
0
 public function testNewClassInstance()
 {
     $exception = GClass::newClassInstance('Psc\\Exception', array('just a test error'));
     $this->assertInstanceOf('Psc\\Exception', $exception);
     $this->assertEquals('just a test error', $exception->getMessage());
     $exception = GClass::newClassInstance($gClass = new GClass('Psc\\Exception'), array('just a test error'));
     $this->assertInstanceOf('Psc\\Exception', $exception);
     $this->assertEquals('just a test error', $exception->getMessage());
     $exception = GClass::newClassInstance($gClass->getReflection(), array('just a test error'));
     $this->assertInstanceOf('Psc\\Exception', $exception);
     $this->assertEquals('just a test error', $exception->getMessage());
 }
Example #3
0
 /**
  * @return Object
  */
 public function getControllerInstance(GClass $class)
 {
     $controller = $class->getReflection()->newInstanceArgs(array_slice(func_get_args(), 1));
     return $controller;
 }