for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Phile\Plugin\Phile\ParserMeta\Tests;
use Phile\Plugin\Phile\ParserMeta\Parser\Meta;
use Phile\Test\TestCase;
class MetaTest extends TestCase
{
public function testYamlWithYamlFrontMatter()
$this->createPhileCore()->bootstrap();
$raw = <<<EOF
---
Title: foo
Tags: [bar, baz]
Page Content
EOF;
$parser = new Meta([
'fences' => ['yaml' => ['open' => '---', 'close' => '---']],
'format' => 'YAML'
]);
$meta = $parser->extractMeta($raw);
$this->assertSame('foo', $meta['title']);
$this->assertSame(['bar', 'baz'], $meta['tags']);
}
public function testDataWithoutMetaDataBlock()
$raw = "# Hello World\n## Hello you too";
$content = $parser->extractContent($raw);
$this->assertSame($raw, $content);
$this->assertSame([], $meta);