Files
ik-codex/test/tests/Printer/DefaultPrinterTest.php
indifferentketchup 66a2fcc5f3 Rename namespace Aternos\Codex to IndifferentKetchup\Codex
Bulk substitution across all PHP files in src/ and test/. Covers
namespace declarations, use statements, fully-qualified class
references, and @package PHPDoc tags. No logic changes.
2026-04-30 15:13:52 +00:00

36 lines
1004 B
PHP

<?php
namespace IndifferentKetchup\Codex\Test\Tests\Printer;
use IndifferentKetchup\Codex\Log\Entry;
use IndifferentKetchup\Codex\Log\File\PathLogFile;
use IndifferentKetchup\Codex\Log\Line;
use IndifferentKetchup\Codex\Log\Log;
use IndifferentKetchup\Codex\Printer\DefaultPrinter;
use PHPUnit\Framework\TestCase;
class DefaultPrinterTest extends TestCase
{
public function testPrint(): void
{
$logFile = new PathLogFile(__DIR__ . "/../../data/simple.log");
$log = new Log();
$log->setLogFile($logFile);
$log->parse();
$printer = new DefaultPrinter();
$printer->setLog($log);
$this->assertEquals($logFile->getContent(), trim($printer->print()));
}
public function testPrintEntry(): void
{
$text = uniqid();
$entry = (new Entry())->addLine(new Line(1, $text));
$printer = new DefaultPrinter();
$printer->setEntry($entry);
$this->assertEquals($text, trim($printer->print()));
}
}