1
0
mirror of https://github.com/flarum/core.git synced 2025-08-05 16:07:34 +02:00

API Client: Use new error handling mechanism

This commit is contained in:
Franz Liedke
2019-08-09 23:57:33 +02:00
parent 57ce25301d
commit 81a8736ba9
10 changed files with 33 additions and 68 deletions

View File

@@ -15,7 +15,6 @@ use Carbon\Carbon;
use Flarum\Api\Controller\ShowDiscussionController;
use Flarum\Discussion\Discussion;
use Flarum\User\User;
use Illuminate\Database\Eloquent\ModelNotFoundException;
class ShowDiscussionControllerTest extends ApiControllerTestCase
{
@@ -73,11 +72,9 @@ class ShowDiscussionControllerTest extends ApiControllerTestCase
*/
public function guest_cannot_see_empty_discussion()
{
$this->expectException(ModelNotFoundException::class);
$response = $this->callWith([], ['id' => 1]);
$this->assertEquals(200, $response->getStatusCode());
$this->assertEquals(404, $response->getStatusCode());
}
/**
@@ -95,8 +92,8 @@ class ShowDiscussionControllerTest extends ApiControllerTestCase
*/
public function guests_cannot_see_private_discussion()
{
$this->expectException(ModelNotFoundException::class);
$response = $this->callWith([], ['id' => 3]);
$this->callWith([], ['id' => 3]);
$this->assertEquals(404, $response->getStatusCode());
}
}