mirror of
https://github.com/Aviortheking/DeltaCMS.git
synced 2025-06-27 15:39:19 +00:00
update
This commit is contained in:
22
tests/LoggerTest.php
Normal file
22
tests/LoggerTest.php
Normal 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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user