Update website
This commit is contained in:
parent
4413528994
commit
1d90fbf296
6865 changed files with 1091082 additions and 0 deletions
30
vendor/doctrine/rst-parser/tests/Meta/CachedMetasLoaderTest.php
vendored
Normal file
30
vendor/doctrine/rst-parser/tests/Meta/CachedMetasLoaderTest.php
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\Tests\RST\Meta;
|
||||
|
||||
use Doctrine\RST\Meta\CachedMetasLoader;
|
||||
use Doctrine\RST\Meta\MetaEntry;
|
||||
use Doctrine\RST\Meta\Metas;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
use function sys_get_temp_dir;
|
||||
|
||||
class CachedMetasLoaderTest extends TestCase
|
||||
{
|
||||
public function testSaveAndLoadCachedMetaEntries(): void
|
||||
{
|
||||
$targetDir = sys_get_temp_dir();
|
||||
$meta1 = new MetaEntry('file1', 'url1', 'title1', [], [], [], [], 0);
|
||||
$meta2 = new MetaEntry('file2', 'url2', 'title2', [], [], [], [], 0);
|
||||
|
||||
$metasBefore = new Metas([$meta1, $meta2]);
|
||||
$metasAfter = new Metas();
|
||||
|
||||
$loader = new CachedMetasLoader();
|
||||
$loader->cacheMetaEntries($targetDir, $metasBefore);
|
||||
$loader->loadCachedMetaEntries($targetDir, $metasAfter);
|
||||
self::assertEquals([$meta1, $meta2], $metasAfter->getAll());
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue