gl-website-deployer/vendor/doctrine/rst-parser/tests/BuilderInclude/BuilderIncludeTest.php

42 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2024-11-19 08:02:04 +01:00
<?php
declare(strict_types=1);
namespace Doctrine\Tests\RST\BuilderInclude;
use Doctrine\Tests\RST\BaseBuilderTest;
use function assert;
use function file_exists;
use function file_get_contents;
/**
* Unit testing build with ".. include::" directive
*/
class BuilderIncludeTest extends BaseBuilderTest
{
public function testTocTreeGlob(): void
{
self::assertTrue(file_exists($this->targetFile('index.html')));
$contents = file_get_contents($this->targetFile('index.html'));
assert($contents !== false);
self::assertStringContainsString('This file is included', $contents);
foreach ($this->builder->getDocuments()->getAll() as $document) {
foreach ($document->getEnvironment()->getMetas()->getAll() as $meta) {
foreach ($meta->getTocs() as $toc) {
foreach ($toc as $tocLine) {
self::assertStringNotContainsString('include.inc', $tocLine);
}
}
}
}
}
protected function getFixturesDirectory(): string
{
return 'BuilderInclude';
}
}