/** @test */ public function it_responds_internal_error_when_something_bad_happens() { $this->speakers->shouldReceive('findProfile')->andThrow(new Exception('Zomgz it blew up somehow.')); $response = $this->sut->handleShowSpeakerProfile($this->getRequest()); $this->assertEquals(500, $response->getStatusCode()); $this->assertContains('Zomgz it blew up somehow', $response->getContent()); }
/** @test */ public function it_should_respond_unauthorized_when_no_authentication_provided() { $this->speakers->shouldReceive('getTalks')->andThrow(\OpenCFP\Domain\Services\NotAuthenticatedException::class); $response = $this->sut->handleViewAllTalks($this->getValidRequest()); $this->assertEquals(401, $response->getStatusCode()); $this->assertContains('Unauthorized', $response->getContent()); }