mirror of
https://github.com/flarum/framework.git
synced 2025-06-03 22:43:10 +08:00

committed by
Daniël Klabbers

parent
42a7f2f586
commit
970c0f5604
@ -13,6 +13,7 @@ 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
|
||||
{
|
||||
@ -67,10 +68,11 @@ class ShowDiscussionControllerTest extends ApiControllerTestCase
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @expectedException \Illuminate\Database\Eloquent\ModelNotFoundException
|
||||
*/
|
||||
public function guest_cannot_see_empty_discussion()
|
||||
{
|
||||
$this->expectException(ModelNotFoundException::class);
|
||||
|
||||
$response = $this->callWith([], ['id' => 1]);
|
||||
|
||||
$this->assertEquals(200, $response->getStatusCode());
|
||||
@ -88,10 +90,11 @@ class ShowDiscussionControllerTest extends ApiControllerTestCase
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @expectedException \Illuminate\Database\Eloquent\ModelNotFoundException
|
||||
*/
|
||||
public function guests_cannot_see_private_discussion()
|
||||
{
|
||||
$this->expectException(ModelNotFoundException::class);
|
||||
|
||||
$this->callWith([], ['id' => 3]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user