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.
Passed
Pull Request — master (#821)
by
unknown
09:41
created

HelperTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 29
c 1
b 0
f 0
dl 0
loc 55
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A canGetIndexNameFromUid() 0 42 2
A setUp() 0 6 1
1
<?php
2
3
namespace Kitodo\Dlf\Tests\Functional\Common;
4
5
use Kitodo\Dlf\Common\Helper;
6
use Kitodo\Dlf\Tests\Functional\FunctionalTestCase;
7
8
class HelperTest extends FunctionalTestCase
9
{
10
    public function setUp(): void
11
    {
12
        parent::setUp();
13
14
        $this->importDataSet(__DIR__ . '/../../Fixtures/Common/libraries.xml');
15
        $this->importDataSet(__DIR__ . '/../../Fixtures/Common/metadata.xml');
16
    }
17
18
    /**
19
     * @test
20
     */
21
    public function canGetIndexNameFromUid()
22
    {
23
        // Repeat to make sure caching isn't broken
24
        for ($n = 0; $n < 2; $n++) {
25
            // Good UID, no PID
26
            $this->assertEquals(
27
                'default',
28
                Helper::getIndexNameFromUid(10001, 'tx_dlf_libraries')
29
            );
30
            $this->assertEquals(
31
                'title',
32
                Helper::getIndexNameFromUid(5001, 'tx_dlf_metadata')
33
            );
34
            $this->assertEquals(
35
                'collection',
36
                Helper::getIndexNameFromUid(5002, 'tx_dlf_metadata')
37
            );
38
39
            // Good UID, good PID
40
            $this->assertEquals(
41
                'default',
42
                Helper::getIndexNameFromUid(10001, 'tx_dlf_libraries', 20000)
43
            );
44
            $this->assertEquals(
45
                'title',
46
                Helper::getIndexNameFromUid(5001, 'tx_dlf_metadata', 20000)
47
            );
48
            $this->assertEquals(
49
                'collection',
50
                Helper::getIndexNameFromUid(5002, 'tx_dlf_metadata', 20000)
51
            );
52
53
            // Good UID, bad PID
54
            $this->assertEquals(
55
                '',
56
                Helper::getIndexNameFromUid(10001, 'tx_dlf_libraries', 123456)
57
            );
58
59
            // Bad UID, no PID
60
            $this->assertEquals(
61
                '',
62
                Helper::getIndexNameFromUid(123456, 'tx_dlf_libraries')
63
            );
64
        }
65
    }
66
}
67