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

54 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
namespace Doctrine\Tests\RST;
use Doctrine\RST\Meta\MetaEntry;
use Doctrine\RST\Meta\Metas;
use PHPUnit\Framework\TestCase;
class MetasTest extends TestCase
{
public function testFindLinkMetaEntry(): void
{
$entry1 = new MetaEntry(
'test.rst',
'test.html',
'Test',
[],
[],
[],
[
'link1' => '/link1',
'link2' => '/link2',
],
0
);
$entry2 = new MetaEntry(
'test.rst',
'test.html',
'Test',
[],
[],
[],
[
'link3' => '/link3',
'link4' => '/link4',
],
0
);
$metas = new Metas([
$entry1,
$entry2,
]);
self::assertSame($entry1, $metas->findLinkMetaEntry('link1'));
self::assertSame($entry1, $metas->findLinkMetaEntry('link2'));
self::assertSame($entry2, $metas->findLinkMetaEntry('link3'));
self::assertSame($entry2, $metas->findLinkMetaEntry('link4'));
}
}