MetaTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 16
c 1
b 1
f 0
dl 0
loc 22
ccs 8
cts 8
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testYamlWithYamlFrontMatter() 0 20 1
1
<?php
2
3
namespace Phile\Plugin\Phile\ParserMeta\Tests;
4
5
use Phile\Plugin\Phile\ParserMeta\Parser\Meta;
6
use Phile\Test\TestCase;
7
8
class MetaTest extends TestCase
9
{
10 1
    public function testYamlWithYamlFrontMatter()
11
    {
12 1
        $this->createPhileCore()->bootstrap();
13
14 1
        $raw = <<<EOF
15
---
16
Title: foo 
17
Tags: [bar, baz]
18
---
19
20
Page Content
21
EOF;
22
23 1
        $parser = new Meta([
24 1
            'fences' => ['yaml' => ['open' => '---', 'close' => '---']],
25
            'format' => 'YAML'
26
        ]);
27 1
        $meta = $parser->parse($raw);
28 1
        $this->assertSame('foo', $meta['title']);
29 1
        $this->assertSame(['bar', 'baz'], $meta['tags']);
30
    }
31
}
32