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 (#894)
by
unknown
06:09 queued 02:52
created

AudioVideaoMDTest::noDuration()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 10
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 22
rs 9.9332
1
<?php
2
3
namespace Kitodo\Dlf\Tests\Unit\Format;
4
5
use Kitodo\Dlf\Format\AudioVideoMD;
6
use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
7
8
class AudioVideaoMDTest extends UnitTestCase
9
{
10
    protected $metadata = [];
11
12
    public function setUp(): void
13
    {
14
        parent::setUp();
15
16
        $this->metadata = [
17
            'duration' => [],
18
            'video_duration' => [],
19
            'audio_duration' => []
20
        ];
21
    }
22
23
    /**
24
     * @test
25
     * @group extractMetadata
26
     */
27
    public function canExtractVideoDuration(): void
28
    {
29
        $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/audioVideo.xml');
30
        $audioVideoMD = new AudioVideoMD();
31
32
        $videoXml = $xml->xpath('//videomd:VIDEOMD')[0];
33
34
        $audioVideoMD->extractMetadata($videoXml,$this->metadata);
35
36
        $this->assertEquals(
37
            ["00:01:30.07"],
38
            $this->metadata['duration']
39
        );
40
41
        $this->assertEquals(
42
            ["00:01:30.07"],
43
            $this->metadata['video_duration']
44
        );
45
46
        $this->assertEquals(
47
            [],
48
            $this->metadata['audio_duration']
49
        );
50
    }
51
52
    /**
53
     * @test
54
     * @group extractMetadata
55
     */
56
    public function canExtractAudioDuration(): void
57
    {
58
        $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/audioVideo.xml');
59
        $audioVideoMD = new AudioVideoMD();
60
61
        $audioXml = $xml->xpath('//audiomd:AUDIOMD')[0];
62
63
        $audioVideoMD->extractMetadata($audioXml,$this->metadata);
64
65
        $this->assertEquals(
66
            ["01:10:35.08"],
67
            $this->metadata['duration']
68
        );
69
70
        $this->assertEquals(
71
            [],
72
            $this->metadata['video_duration']
73
        );
74
75
        $this->assertEquals(
76
            ["01:10:35.08"],
77
            $this->metadata['audio_duration']
78
        );
79
    }
80
81
    /**
82
     * @test
83
     * @group extractMetadata
84
     */
85
    public function noDuration(): void
86
    {
87
        $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/audioVideo.xml');
88
        $audioVideoMD = new AudioVideoMD();
89
90
        $videoXml = $xml->xpath('//audiomd:AUDIOMD')[1];
91
92
        $audioVideoMD->extractMetadata($videoXml,$this->metadata);
93
94
        $this->assertEquals(
95
            [],
96
            $this->metadata['duration']
97
        );
98
99
        $this->assertEquals(
100
            [],
101
            $this->metadata['audio_duration']
102
        );
103
104
        $this->assertEquals(
105
            [],
106
            $this->metadata['video_duration']
107
        );
108
    }
109
}
110