registerParser('foo', $c); $this->assertSame($c, $r->getParser('foo')); } public function testReturnsNullWhenNotFound() { $r = new ParserRegistry(); $this->assertNull($r->getParser('FOO')); } public function testReturnsLazyLoadedDefault() { $r = new ParserRegistry(); $c = $r->getParser('cookie'); $this->assertInstanceOf('Guzzle\Parser\Cookie\CookieParser', $c); $this->assertSame($c, $r->getParser('cookie')); } }