AppExtensionTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 20
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testMarkdownToHtml() 0 7 1
A markdownProvider() 0 6 1
1
<?php
2
3
namespace Tests\AppBundle\Twig;
4
5
use AppBundle\Twig\AppExtension;
6
use Mni\FrontYAML\Parser;
7
8
class AppExtensionTest extends \PHPUnit_Framework_TestCase
9
{
10
    /**
11
     * @dataProvider markdownProvider
12
     */
13
    public function testMarkdownToHtml($md, $expected)
14
    {
15
        $parser = new Parser();
16
        $appExtension = new AppExtension($parser);
17
        $html = $appExtension->markdownToHtml($md);
18
        $this->assertEquals($html, $expected);
19
    }
20
21
    public static function markdownProvider()
22
    {
23
        return [
24
            [file_get_contents(__DIR__.'/../Fixtures/content_1.md'), file_get_contents(__DIR__.'/../Fixtures/content_1.html')]
25
        ];
26
    }
27
}