public function tryGetRepository($key) { if ($this->hasRepository($key)) { return $this->map[$key]; } else { return null; } }
public function testTryGetNonExistentRepositoryReturnsNull() { $registry = new RepositoryRegistry(); $this->assertNull($registry->tryGetRepository('a')); }