/** * Gets the response parser to set on commands * * @return \Guzzle\Service\Command\ResponseParserInterface */ public function getResponseParser() { // @codeCoverageIgnoreStart if (!$this->parser) { $this->parser = ResponseParser::getInstance(); $this->parser->addVisitor('links', new LinksVisitor()); $this->parser->addVisitor('embedded', new EmbeddedVisitor()); } // @codeCoverageIgnoreEnd return $this->parser; }
/** * @covers Desk\Relationship\ResponseParser::getInstance */ public function testGetInstance() { // Clear instance to start with, so we hit the code path where // it is unset $class = new ReflectionClass($this->getMockedClass()); $property = $class->getProperty('relationshipInstance'); $property->setAccessible(true); $property->setValue(null); $instance = ResponseParser::getInstance(); $this->assertInstanceOf($this->getMockedClass(), $instance); }