Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

HelperTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 20
c 0
b 0
f 0
dl 0
loc 39
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A assertInvalidXml() 0 4 1
A validXmlIsAccepted() 0 11 1
A invalidXmlYieldsFalse() 0 10 1
1
<?php
2
3
/**
4
 * (c) Kitodo. Key to digital objects e.V. <[email protected]>
5
 *
6
 * This file is part of the Kitodo and TYPO3 projects.
7
 *
8
 * @license GNU General Public License version 3 or later.
9
 * For the full copyright and license information, please read the
10
 * LICENSE.txt file that was distributed with this source code.
11
 */
12
13
namespace Kitodo\Dlf\Tests\Unit\Common;
14
15
use Kitodo\Dlf\Common\Helper;
16
use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
17
18
class HelperTest extends UnitTestCase
19
{
20
    public function assertInvalidXml($xml)
21
    {
22
        $result = Helper::getXmlFileAsString($xml);
23
        self::assertEquals(false, $result);
24
    }
25
26
    /**
27
     * @test
28
     * @group getXmlFileAsString
29
     */
30
    public function invalidXmlYieldsFalse(): void
31
    {
32
        self::assertInvalidXml(false);
0 ignored issues
show
Bug Best Practice introduced by
The method Kitodo\Dlf\Tests\Unit\Co...est::assertInvalidXml() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

32
        self::/** @scrutinizer ignore-call */ 
33
              assertInvalidXml(false);
Loading history...
33
        self::assertInvalidXml(null);
34
        self::assertInvalidXml(1);
35
        self::assertInvalidXml([]);
36
        self::assertInvalidXml(new \stdClass());
37
        self::assertInvalidXml('');
38
        self::assertInvalidXml('not xml');
39
        self::assertInvalidXml('<tag-not-closed>');
40
    }
41
42
    /**
43
     * @test
44
     * @group getXmlFileAsString
45
     */
46
    public function validXmlIsAccepted(): void
47
    {
48
        $xml = <<<XML
49
<?xml version="1.0" encoding="UTF-8"?>
50
<root>
51
    <single />
52
</root>
53
XML;
54
        $node = Helper::getXmlFileAsString($xml);
55
        self::assertIsObject($node);
56
        self::assertEquals('root', $node->getName());
57
    }
58
}
59