logseq2gemtext/tests/ParserTest.php

31 lines
756 B
PHP

<?php
declare(strict_types=1);
namespace LogseqGem\Tests;
use PHPUnit\Framework\TestCase;
use org\bovigo\vfs\vfsStream;
use org\bovigo\vfs\vfsStreamDirectory;
use League\CommonMark\Node\Block\Document;
use LogseqGem\Parser;
class ParserTest extends TestCase {
private vfsStreamDirectory $root;
public function setUp(): void {
$this->root = vfsStream::setup();
}
public function testParse() {
vfsStream::newFile('test.md')
->withContent("this is a test **markdown** file")
->at($this->root);
$parser = $this->getMockForAbstractClass(Parser::class);
$document = $parser->load(vfsStream::url('root/test.md'));
$this->assertInstanceOf(Document::class, $document);
}
}