PHPUnit: Get rid of deprecated annotation

Refs #1795.
This commit is contained in:
Franz Liedke
2019-07-30 00:09:10 +02:00
committed by Daniël Klabbers
parent 42a7f2f586
commit 970c0f5604
7 changed files with 35 additions and 15 deletions

View File

@ -11,8 +11,10 @@ namespace Flarum\Tests\integration\api\Controller;
use Flarum\Api\Controller\CreateUserController;
use Flarum\Settings\SettingsRepositoryInterface;
use Flarum\User\Exception\PermissionDeniedException;
use Flarum\User\User;
use Illuminate\Support\Arr;
use Illuminate\Validation\ValidationException;
class CreateUserControllerTest extends ApiControllerTestCase
{
@ -46,11 +48,12 @@ class CreateUserControllerTest extends ApiControllerTestCase
/**
* @test
* @expectedException \Illuminate\Validation\ValidationException
* @expectedExceptionMessage The given data was invalid.
*/
public function cannot_create_user_without_data()
{
$this->expectException(ValidationException::class);
$this->expectExceptionMessage('The given data was invalid.');
$this->callWith();
}
@ -94,7 +97,6 @@ class CreateUserControllerTest extends ApiControllerTestCase
/**
* @test
* @expectedException \Flarum\User\Exception\PermissionDeniedException
*/
public function disabling_sign_up_prevents_user_creation()
{
@ -102,6 +104,8 @@ class CreateUserControllerTest extends ApiControllerTestCase
$settings = app(SettingsRepositoryInterface::class);
$settings->set('allow_sign_up', false);
$this->expectException(PermissionDeniedException::class);
try {
$this->callWith($this->data);
} finally {