public function getGenerator($name) { if ($this->hasGenerator($name) === false) { throw new \RuntimeException(sprintf('Generator not found: "%s".', $name)); } return $this->generators[$name]; }
/** * @expectedException \RuntimeException */ public function testGeneratorNotFound() { $generator = new PaginationGenerator(); $gm = new GeneratorManager(); $gm->addGenerator('paginator', $generator); $gm->getGenerator('paginator-1'); }