Passed
Branch dev (6bb8f6)
by Dispositif
03:01
created

ExternActionTest::testExtractLdJson()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 0
dl 0
loc 11
rs 10
c 0
b 0
f 0
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\Application;
11
12
use PHPUnit\Framework\TestCase;
13
14
class ExternActionTest extends TestCase
15
{
16
    public function testGetHTMLSource()
17
    {
18
        $this::markTestIncomplete();
19
    }
20
21
    // TODO refac avec public extractDataFromHtml si Client hors constructor
22
    public function testExtractLdJson()
23
    {
24
        $this::markTestSkipped('after refactoring');
25
26
        $publisher = new ExternalAction('foo');
0 ignored issues
show
Bug introduced by
The type App\Application\ExternalAction was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
27
28
        $source = file_get_contents(__DIR__.'/exampleExternPage.html');
29
        $data = $publisher->extractDataFromHTML($source);
30
        $jsonLd = $data['JSON-LD'];
31
        $this::assertArrayHasKey('@type', $jsonLd);
32
        $this::assertArrayHasKey('headline', $jsonLd);
33
    }
34
}
35