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.
39 lines
1.2 KiB
PHP
39 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace IndifferentKetchup\Codex\Test\Tests\Printer;
|
|
|
|
use IndifferentKetchup\Codex\Log\Entry;
|
|
use IndifferentKetchup\Codex\Log\File\StringLogFile;
|
|
use IndifferentKetchup\Codex\Log\Line;
|
|
use IndifferentKetchup\Codex\Log\Log;
|
|
use IndifferentKetchup\Codex\Printer\ModifiableDefaultPrinter;
|
|
use IndifferentKetchup\Codex\Test\Src\Printer\TestModification;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class ModifiableDefaultPrinterTest extends TestCase
|
|
{
|
|
|
|
public function testPrint(): void
|
|
{
|
|
$logFile = new StringLogFile("This is foo!");
|
|
$log = new Log();
|
|
$log->setLogFile($logFile);
|
|
$log->parse();
|
|
|
|
$printer = new ModifiableDefaultPrinter();
|
|
$printer->addModification(new TestModification());
|
|
$printer->setLog($log);
|
|
$this->assertEquals("This is bar!", trim($printer->print()));
|
|
}
|
|
|
|
public function testPrintEntry(): void
|
|
{
|
|
$entry = (new Entry())->addLine(new Line(1, "This is foo!"));
|
|
|
|
$printer = new ModifiableDefaultPrinter();
|
|
$printer->setModifications([new TestModification()]);
|
|
$printer->setEntry($entry);
|
|
$this->assertEquals("This is bar!", trim($printer->print()));
|
|
}
|
|
}
|