/** * @param string $serverAlias * * @return ServerInterface */ private function guessServer($serverAlias) { if (self::USE_DEFAULT_KEY == $serverAlias) { return $this->serverRegistry->getDefault(); } elseif ($this->container->has($serverAlias)) { return $this->container->get($serverAlias); } else { return $this->serverRegistry->get($serverAlias); } }
/** * @expectedException \InvalidArgumentException * @expectedExceptionCode 1 */ public function testGetNotExistingService() { $reg = new ServerRegistry(); $reg->get('foo'); }