gl-website-deployer/vendor/doctrine/rst-parser/tests/RefInsideDirective/BuilderTest.php
2024-11-19 08:02:04 +01:00

36 lines
906 B
PHP

<?php
declare(strict_types=1);
namespace Doctrine\Tests\RST\RefInsideDirective;
use Doctrine\RST\Builder;
use Doctrine\RST\Kernel;
use PHPUnit\Framework\TestCase;
use function assert;
use function file_get_contents;
class BuilderTest extends TestCase
{
public function testRefInsideDirective(): void
{
$kernel = new Kernel(null, [new VersionAddedDirective()]);
$builder = new Builder($kernel);
$builder->getConfiguration()->setUseCachedMetas(false);
$builder->build(
__DIR__ . '/input',
__DIR__ . '/output'
);
$expected = 'Test a reference in a directive <a href="file.html#some_reference">A file</a>.';
$contents = file_get_contents(__DIR__ . '/output/index.html');
assert($contents !== false);
self::assertStringContainsString(
$expected,
$contents
);
}
}