Пример #1
0
 /**
  * {@inheritdoc}
  *
  * @return MeetupResponseParser|ResponseParserInterface
  */
 public function getResponseParser()
 {
     if (!$this->responseParser) {
         $this->responseParser = MeetupResponseParser::getInstance();
     }
     return $this->responseParser;
 }
 /**
  * @param $response
  * @param $expectedResponse
  *
  * @dataProvider provideForParse
  */
 public function testParse($response, $expectedResponse)
 {
     $command = $this->buildCommand($response);
     $responder = MeetupResponseParser::getInstance();
     $result = $responder->parse($command);
     switch ($expectedResponse) {
         case 'multi':
             $this->assertInstanceOf('\\DMS\\Service\\Meetup\\Response\\MultiResultResponse', $result);
             break;
         case 'single':
             $this->assertInstanceOf('\\DMS\\Service\\Meetup\\Response\\SingleResultResponse', $result);
             $this->assertNotNull($result['a']);
             break;
         case 'basic':
             $this->assertInstanceOf('\\Guzzle\\Http\\Message\\Response', $result);
             break;
     }
 }