mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 22:33:44 +02:00
update tests to use new factories
This commit is contained in:
@@ -15,7 +15,7 @@ class AccountControllerTest extends ClientApiIntegrationTestCase
|
||||
public function testAccountDetailsAreReturned()
|
||||
{
|
||||
/** @var \Pterodactyl\Models\User $user */
|
||||
$user = factory(User::class)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get('/api/client/account');
|
||||
|
||||
@@ -39,7 +39,7 @@ class AccountControllerTest extends ClientApiIntegrationTestCase
|
||||
public function testEmailIsUpdated()
|
||||
{
|
||||
/** @var \Pterodactyl\Models\User $user */
|
||||
$user = factory(User::class)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->putJson('/api/client/account/email', [
|
||||
'email' => 'hodor@example.com',
|
||||
@@ -58,7 +58,7 @@ class AccountControllerTest extends ClientApiIntegrationTestCase
|
||||
public function testEmailIsNotUpdatedWhenPasswordIsInvalid()
|
||||
{
|
||||
/** @var \Pterodactyl\Models\User $user */
|
||||
$user = factory(User::class)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->putJson('/api/client/account/email', [
|
||||
'email' => 'hodor@example.com',
|
||||
@@ -77,7 +77,7 @@ class AccountControllerTest extends ClientApiIntegrationTestCase
|
||||
public function testEmailIsNotUpdatedWhenNotValid()
|
||||
{
|
||||
/** @var \Pterodactyl\Models\User $user */
|
||||
$user = factory(User::class)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->putJson('/api/client/account/email', [
|
||||
'email' => '',
|
||||
@@ -104,7 +104,7 @@ class AccountControllerTest extends ClientApiIntegrationTestCase
|
||||
public function testPasswordIsUpdated()
|
||||
{
|
||||
/** @var \Pterodactyl\Models\User $user */
|
||||
$user = factory(User::class)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$mock = Mockery::mock(AuthManager::class);
|
||||
$mock->expects('logoutOtherDevices')->with('New_Password1');
|
||||
@@ -127,7 +127,7 @@ class AccountControllerTest extends ClientApiIntegrationTestCase
|
||||
public function testPasswordIsNotUpdatedIfCurrentPasswordIsInvalid()
|
||||
{
|
||||
/** @var \Pterodactyl\Models\User $user */
|
||||
$user = factory(User::class)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->putJson('/api/client/account/password', [
|
||||
'current_password' => 'invalid',
|
||||
@@ -146,7 +146,7 @@ class AccountControllerTest extends ClientApiIntegrationTestCase
|
||||
*/
|
||||
public function testErrorIsReturnedForInvalidRequestData()
|
||||
{
|
||||
$user = factory(User::class)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$this->actingAs($user)->putJson('/api/client/account/password', [
|
||||
'current_password' => 'password',
|
||||
@@ -170,7 +170,7 @@ class AccountControllerTest extends ClientApiIntegrationTestCase
|
||||
public function testErrorIsReturnedIfPasswordIsNotConfirmed()
|
||||
{
|
||||
/** @var \Pterodactyl\Models\User $user */
|
||||
$user = factory(User::class)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->putJson('/api/client/account/password', [
|
||||
'current_password' => 'password',
|
||||
|
||||
Reference in New Issue
Block a user