mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2026-11-20 23:43:26 +03:00
20 lines
722 B
PHP
20 lines
722 B
PHP
<?php
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class ViewlogOutputSecurityTest extends TestCase {
|
|
public function testControllerUsesDefaultOutputSanitisation(): void {
|
|
$controller = file_get_contents(__DIR__ . '/../public/viewlog.php');
|
|
|
|
$this->assertStringContainsString("assign('tLog', \$tLog);", $controller);
|
|
$this->assertStringNotContainsString("assign('tLog', \$tLog, false)", $controller);
|
|
}
|
|
|
|
public function testTemplateDoesNotEmbedLogDataInJavascript(): void {
|
|
$template = file_get_contents(__DIR__ . '/../templates/viewlog.tpl');
|
|
|
|
$this->assertStringNotContainsString('onclick=', $template);
|
|
$this->assertStringContainsString('<details>', $template);
|
|
}
|
|
}
|