Merge branch 'develop' into v2
This commit is contained in:
commit
b26556e201
12 changed files with 59 additions and 51 deletions
|
@ -2,10 +2,9 @@
|
|||
|
||||
namespace Pterodactyl\Tests\Integration\Api\Client;
|
||||
|
||||
use Mockery;
|
||||
use Pterodactyl\Models\User;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Auth\AuthManager;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class AccountControllerTest extends ClientApiIntegrationTestCase
|
||||
{
|
||||
|
@ -104,10 +103,7 @@ class AccountControllerTest extends ClientApiIntegrationTestCase
|
|||
/** @var \Pterodactyl\Models\User $user */
|
||||
$user = User::factory()->create();
|
||||
|
||||
$mock = Mockery::mock(AuthManager::class);
|
||||
$mock->expects('logoutOtherDevices')->with('New_Password1');
|
||||
|
||||
$this->app->instance(AuthManager::class, $mock);
|
||||
$initialHash = $user->password;
|
||||
|
||||
$response = $this->actingAs($user)->putJson('/api/client/account/password', [
|
||||
'current_password' => 'password',
|
||||
|
@ -115,6 +111,12 @@ class AccountControllerTest extends ClientApiIntegrationTestCase
|
|||
'password_confirmation' => 'New_Password1',
|
||||
]);
|
||||
|
||||
$user = $user->refresh();
|
||||
|
||||
$this->assertNotEquals($user->password, $initialHash);
|
||||
$this->assertTrue(Hash::check('New_Password1', $user->password));
|
||||
$this->assertFalse(Hash::check('password', $user->password));
|
||||
|
||||
$response->assertStatus(Response::HTTP_NO_CONTENT);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue