20 lines
357 B
PHP
20 lines
357 B
PHP
<?php
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use App\Util\Logger;
|
|
|
|
class LoggerTest extends TestCase
|
|
{
|
|
public function testLogWritesMessage()
|
|
{
|
|
$tmp = tempnam(sys_get_temp_dir(), 'log_');
|
|
$logger = new Logger($tmp);
|
|
|
|
$logger->log("Hello world");
|
|
|
|
$contents = file_get_contents($tmp);
|
|
|
|
$this->assertStringContainsString("Hello world", $contents);
|
|
}
|
|
}
|