This commit is contained in:
2019-04-12 16:56:36 +02:00
parent bf4e1d44c0
commit b80210ed64
16 changed files with 448 additions and 123 deletions

22
tests/LoggerTest.php Normal file
View File

@ -0,0 +1,22 @@
<?php
use PHPUnit\Framework\TestCase;
use AdminPanel\Cache\FileCache;
use AdminPanel\Logger\Logger;
final class LoggerTest extends TestCase
{
public function testCanLog()
{
$file = "tests/logs.log";
$logger = new Logger($file);
$this->assertFileExists($file);
$logger->info("test");
$this->assertStringEqualsFile(
$file,
"[Info]: " . (new \DateTime())->format("Y-m-d H:i:s") . " test\n"
);
unlink($file);
}
}