Initial import from aternosorg/codex-minecraft
This commit is contained in:
25
test/tests/Printer/PatternModificationTest.php
Normal file
25
test/tests/Printer/PatternModificationTest.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Codex\Test\Tests\Printer;
|
||||
|
||||
use Aternos\Codex\Log\File\StringLogFile;
|
||||
use Aternos\Codex\Log\Log;
|
||||
use Aternos\Codex\Printer\ModifiableDefaultPrinter;
|
||||
use Aternos\Codex\Printer\PatternModification;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class PatternModificationTest 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 PatternModification('/foo/', 'bar'));
|
||||
$printer->setLog($log);
|
||||
$this->assertEquals("This is bar!", trim($printer->print()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user