Ejemplo n.º 1
0
 public function handleViewTalk(Request $request, $id)
 {
     try {
         $talk = $this->speakers->getTalk($id);
         return $this->setStatusCode(Response::HTTP_OK)->respond($talk->toArrayForApi());
     } catch (NotAuthenticatedException $e) {
         return $this->respondUnauthorized();
     }
 }
Ejemplo n.º 2
0
 /** @test */
 public function it_guards_if_spot_relation_ever_returns_talks_that_arent_owned_by_speaker()
 {
     $this->trainIdentityProviderToReturnSampleSpeaker($this->getSpeakerFromMisbehavingSpot());
     $this->setExpectedException('OpenCFP\\Application\\NotAuthorizedException');
     $this->sut->getTalk(1);
 }
Ejemplo n.º 3
0
 /** @test */
 public function it_guards_if_spot_relation_ever_returns_talks_that_arent_owned_by_speaker()
 {
     $this->trainStudentRepositoryToReturnSampleSpeaker($this->getSpeakerFromMisbehavingSpot());
     $this->setExpectedException('OpenCFP\\Application\\NotAuthorizedException');
     $this->sut->getTalk(self::SPEAKER_ID, 1);
 }