コード例 #1
0
ファイル: GClassTest.php プロジェクト: pscheit/psc-cms
 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());
 }
コード例 #2
0
ファイル: Instancer.php プロジェクト: pscheit/psc-cms
 protected function newObject($role, array $params)
 {
     return \Psc\Code\Generate\GClass::newClassInstance($this->container->getRoleFQN($role), $params);
 }