mirror of
https://github.com/flarum/framework.git
synced 2025-05-22 22:59:57 +08:00

committed by
Daniël Klabbers

parent
42a7f2f586
commit
970c0f5604
@ -13,6 +13,7 @@ use Flarum\Api\Controller\CreateDiscussionController;
|
||||
use Flarum\Discussion\Discussion;
|
||||
use Flarum\User\User;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
class CreateDiscussionControllerTest extends ApiControllerTestCase
|
||||
{
|
||||
@ -63,8 +64,6 @@ class CreateDiscussionControllerTest extends ApiControllerTestCase
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @expectedException \Illuminate\Validation\ValidationException
|
||||
* @expectedExceptionMessage The given data was invalid.
|
||||
*/
|
||||
public function cannot_create_discussion_without_content()
|
||||
{
|
||||
@ -72,13 +71,14 @@ class CreateDiscussionControllerTest extends ApiControllerTestCase
|
||||
|
||||
$data = Arr::except($this->data, 'content');
|
||||
|
||||
$this->expectException(ValidationException::class);
|
||||
$this->expectExceptionMessage('The given data was invalid.');
|
||||
|
||||
$this->callWith($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @expectedException \Illuminate\Validation\ValidationException
|
||||
* @expectedExceptionMessage The given data was invalid.
|
||||
*/
|
||||
public function cannot_create_discussion_without_title()
|
||||
{
|
||||
@ -86,6 +86,9 @@ class CreateDiscussionControllerTest extends ApiControllerTestCase
|
||||
|
||||
$data = Arr::except($this->data, 'title');
|
||||
|
||||
$this->expectException(ValidationException::class);
|
||||
$this->expectExceptionMessage('The given data was invalid.');
|
||||
|
||||
$this->callWith($data);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user