TwigCommentFrontMatterTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 12
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCreate() 0 9 1
1
<?php
2
3
/*
4
 * This is part of the webuni/front-matter package.
5
 *
6
 * (c) Martin Hasoň <[email protected]>
7
 * (c) Webuni s.r.o. <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace Webuni\FrontMatter\Tests\Twig;
14
15
use PHPUnit\Framework\TestCase;
16
use Webuni\FrontMatter\FrontMatter;
17
use Webuni\FrontMatter\Twig\TwigCommentFrontMatter;
18
19
class TwigCommentFrontMatterTest extends TestCase
20
{
21
    public function testCreate()
22
    {
23
        $frontMatter = TwigCommentFrontMatter::create();
24
        $this->assertInstanceOf(FrontMatter::class, $frontMatter);
25
26
        $document = $frontMatter->parse("{#---\nfoo: bar\n---#}\nContent\n");
27
        $this->assertEquals(['foo' => 'bar'], $document->getData());
28
        $this->assertEquals("Content\n", $document->getContent());
29
    }
30
}
31