예제 #1
0
 /**
  * @expectedException \RcmIssuu\Exception\InvalidFormatException
  */
 public function testGetEmbedInvalidFormatReturned()
 {
     $client = $this->service->getClient();
     $expected = array();
     $mock = new MockPlugin();
     $mock->addResponse(new Response(200, null, json_encode($expected)));
     $client->addSubscriber($mock);
     $this->service->getEmbed('test_account', 'test_title');
 }
예제 #2
0
 /**
  * Return single resource
  *
  * @param  mixed $id Id to retrieve
  *
  * @return JsonModel|Response
  */
 public function get($id)
 {
     if (!$this->rcmIsSiteAdmin($this->currentSite)) {
         $response = new Response();
         $response->setStatusCode('401');
         return $response;
     }
     $userName = $this->params('username');
     $doc = $this->api->getEmbed($userName, $id);
     return new JsonModel($doc);
 }