unitTestsAreRunning = true;
parent::setUp();
$this->clearDbState();
// Create new class
$this->users = $this->initBaseClassObjectBySiteMapId();
}
protected function tearDown(): void
{
$this->clearDbState();
parent::tearDown();
}
protected function clearDbState(): void
{
$this->resetGetAndPost();
$this->logOutUnitTestUser();
$this->reloadDbTables(['mod_users', 'mod_account_manager']);
}
public function testLoginActionRequests(): void
{
// Check while logged in
try {
$this->users->loginAction();
$this->fail('Exception Expected!');
} catch (Exception $error) {
$this->assertExpected(['Redirected to Location'], $error->getMessage());
}
// Try force login
// Generate base HTML layout & save output to var
ob_start();
$this->setGet(['action' => 'loginf']);
$this->users->loginAction();
$pageHTML = ob_get_contents();
ob_end_clean();
$this->assertExpected(
[
'
Zutenis | Autentifikācija',
'Ienākt grāmatvedības sistēmā',
'',
'