cerebrate/tests/TestCase/Controller/Users/UsersControllerTest.php

33 lines
716 B
PHP
Raw Normal View History

<?php
declare(strict_types=1);
namespace App\Test\TestCase\Controller\Users;
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,
]);
$this->assertSessionHasKey('authUser.uuid');
}
}