PHPUnit: Get rid of deprecated annotation

Refs #1795.
This commit is contained in:
Franz Liedke
2019-07-30 00:09:10 +02:00
parent c2586586c4
commit f357434a72
7 changed files with 35 additions and 15 deletions

View File

@ -13,8 +13,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
{
@ -48,11 +50,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();
}
@ -96,7 +99,6 @@ class CreateUserControllerTest extends ApiControllerTestCase
/**
* @test
* @expectedException \Flarum\User\Exception\PermissionDeniedException
*/
public function disabling_sign_up_prevents_user_creation()
{
@ -104,6 +106,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 {