42 lines
1008 B
PHP
42 lines
1008 B
PHP
<?php
|
|
|
|
namespace ElixirAudit\Tests\UnitTests\App\Index;
|
|
|
|
use Exception;
|
|
|
|
class pageCookiesActionTest extends indexBase
|
|
{
|
|
public function testPageCookiesActionDefaultAction(): void
|
|
{
|
|
ob_start();
|
|
$this->index->pageCookiesAction();
|
|
$pageHTML = ob_get_contents();
|
|
ob_end_clean();
|
|
|
|
$this->assertExpected(
|
|
[
|
|
'<h1 class="to-animate">Sīkdatnes Zutenis vietnē</h1>',
|
|
'<h2 class="to-animate">Spēkā no 2020. gada 1. janvāra</h2>',
|
|
],
|
|
$pageHTML
|
|
);
|
|
}
|
|
|
|
public function testAcceptCookiesAction(): void
|
|
{
|
|
$this->setGet([
|
|
'action' => 'accept-cookies'
|
|
]);
|
|
|
|
try {
|
|
$this->index->pageCookiesAction();
|
|
$this->fail("Exception expected!");
|
|
} catch (Exception $error) {
|
|
$this->assertExpected(
|
|
['{"jsonok":true,"data":true}'],
|
|
$error->getMessage()
|
|
);
|
|
}
|
|
}
|
|
}
|