2022-01-05 17:44:02 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2022-01-07 13:45:52 +01:00
|
|
|
namespace App\Test\TestCase\Controller\Users;
|
2022-01-05 17:44:02 +01:00
|
|
|
|
|
|
|
use Cake\TestSuite\IntegrationTestTrait;
|
|
|
|
use Cake\TestSuite\TestCase;
|
|
|
|
use App\Test\Fixture\UsersFixture;
|
|
|
|
|
|
|
|
class UsersControllerTest extends TestCase
|
|
|
|
{
|
|
|
|
use IntegrationTestTrait;
|
|
|
|
|
|
|
|
protected $fixtures = [
|
|
|
|
'app.Individuals',
|
|
|
|
'app.Roles',
|
|
|
|
'app.Users'
|
|
|
|
];
|
|
|
|
public function testLogin(): void
|
|
|
|
{
|
|
|
|
$this->enableCsrfToken();
|
|
|
|
$this->enableSecurityToken();
|
|
|
|
|
|
|
|
$this->post('/users/login', [
|
2022-01-07 13:47:20 +01:00
|
|
|
'username' => UsersFixture::USER_ADMIN_USERNAME,
|
|
|
|
'password' => UsersFixture::USER_ADMIN_PASSWORD,
|
2022-01-05 17:44:02 +01:00
|
|
|
]);
|
|
|
|
|
|
|
|
$this->assertSessionHasKey('authUser.uuid');
|
|
|
|
}
|
|
|
|
}
|