mirror of
https://github.com/flarum/core.git
synced 2025-08-02 14:37:49 +02:00
@@ -15,6 +15,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
|
||||
{
|
||||
@@ -65,8 +66,6 @@ class CreateDiscussionControllerTest extends ApiControllerTestCase
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @expectedException \Illuminate\Validation\ValidationException
|
||||
* @expectedExceptionMessage The given data was invalid.
|
||||
*/
|
||||
public function cannot_create_discussion_without_content()
|
||||
{
|
||||
@@ -74,13 +73,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()
|
||||
{
|
||||
@@ -88,6 +88,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