gl-website-deployer/vendor/doctrine/rst-parser/tests/BuilderReferences/BuilderReferencesTest.php

38 lines
1010 B
PHP
Raw Permalink Normal View History

2024-11-19 08:02:04 +01:00
<?php
declare(strict_types=1);
namespace Doctrine\Tests\RST\BuilderReferences;
use Doctrine\RST\Builder;
use Doctrine\Tests\RST\BaseBuilderTest;
use Gajus\Dindent\Indenter;
use Symfony\Component\Finder\Finder;
use function rtrim;
class BuilderReferencesTest extends BaseBuilderTest
{
protected function configureBuilder(Builder $builder): void
{
$builder->getConfiguration()->abortOnError(false);
$builder->getConfiguration()->silentOnError();
}
public function test(): void
{
$indenter = new Indenter();
foreach (Finder::create()->files()->in($this->targetFile() . '/../expected') as $file) {
$target = $this->targetFile($file->getRelativePathname());
self::assertFileExists($target);
self::assertEquals(rtrim($file->getContents()), rtrim($indenter->indent($this->getFileContents($target))));
}
}
protected function getFixturesDirectory(): string
{
return 'BuilderReferences';
}
}