Passed
Push — master ( bacc5f...5eccc7 )
by Dispositif
02:22
created

TagParserTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 15
rs 10
wmc 1
1
<?php
2
/**
3
 * This file is part of dispositif/wikibot application
4
 * 2019 : Philippe M. <[email protected]>
5
 * For the full copyright and MIT license information, please view the LICENSE file.
6
 */
7
8
declare(strict_types=1);
9
10
namespace App\Infrastructure;
11
12
use PHPUnit\Framework\TestCase;
13
14
class TagParserTest extends TestCase
15
{
16
    public function testXpath()
17
    {
18
        $text = file_get_contents(__DIR__.'/expected_WikiRef.html');
19
20
        $parser = new TagParser();
21
        $refs = $parser->importHtml($text)->getRefValues();
22
23
        $this::assertSame(
24
            [
25
                'fubar',
26
                '[https://www.lemonde.fr/planete/article/2010/11/25/des-salaries-de-l-association-aide-et-action-mettent-en-cause-la-direction_1444276_3244.html Lemonde.fr, des salariés de l\'association Aide et Action mettent en cause l\'association, 25 novembre 2010]',
27
            ],
28
            $refs
29
        );
30
    }
31
}
32