/** * @return Code */ public function getCode() { if ($this->code === null) { $this->code = Factory::createCode($this->getReflection()); } return $this->code; }
public function testCreateCode() { $code = Factory::createCode(); $this->assertInstanceOf('Runkit\\Code', $code); $reflection = new ReflectionFunction('testFunctionForFactory'); $code = Factory::createCode($reflection); $this->assertInstanceOf('Runkit\\Code', $code); }