From 50fb96b9a41f57e6c2db4409f6f91948a12136e8 Mon Sep 17 00:00:00 2001 From: haogatyp Date: Mon, 30 Jan 2023 10:20:58 +0100 Subject: [PATCH 1/8] Added format unit tests. --- Tests/Fixtures/Format/alto.xml | 66 ++++++ Tests/Fixtures/Format/altoNoString.xml | 59 +++++ Tests/Fixtures/Format/altoNoTextBlock.xml | 38 ++++ Tests/Fixtures/Format/altoNoTextLine.xml | 48 +++++ Tests/Fixtures/Format/audioVideo.xml | 59 +++++ .../Format/modsAuthorNoAutRoleTerm.xml | 126 +++++++++++ .../Format/modsAuthorWithAutRoleTerm.xml | 151 +++++++++++++ Tests/Fixtures/Format/modsOriginInfo.xml | 134 ++++++++++++ .../modsOriginInfoWithEditionElectonicEd.xml | 138 ++++++++++++ Tests/Unit/Format/AltoTest.php | 106 +++++++++ Tests/Unit/Format/AudioVideoMDTest.php | 109 ++++++++++ Tests/Unit/Format/ModsTest.php | 204 ++++++++++++++++++ Tests/Unit/Format/TeiHeaderTest.php | 30 +++ 13 files changed, 1268 insertions(+) create mode 100644 Tests/Fixtures/Format/alto.xml create mode 100644 Tests/Fixtures/Format/altoNoString.xml create mode 100644 Tests/Fixtures/Format/altoNoTextBlock.xml create mode 100644 Tests/Fixtures/Format/altoNoTextLine.xml create mode 100644 Tests/Fixtures/Format/audioVideo.xml create mode 100644 Tests/Fixtures/Format/modsAuthorNoAutRoleTerm.xml create mode 100644 Tests/Fixtures/Format/modsAuthorWithAutRoleTerm.xml create mode 100644 Tests/Fixtures/Format/modsOriginInfo.xml create mode 100644 Tests/Fixtures/Format/modsOriginInfoWithEditionElectonicEd.xml create mode 100644 Tests/Unit/Format/AltoTest.php create mode 100644 Tests/Unit/Format/AudioVideoMDTest.php create mode 100644 Tests/Unit/Format/ModsTest.php create mode 100644 Tests/Unit/Format/TeiHeaderTest.php diff --git a/Tests/Fixtures/Format/alto.xml b/Tests/Fixtures/Format/alto.xml new file mode 100644 index 000000000..770fc554f --- /dev/null +++ b/Tests/Fixtures/Format/alto.xml @@ -0,0 +1,66 @@ + + + + pixel + + + 2020-05-14 + + ABBYY + ABBYY FineReader Engine + 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/Fixtures/Format/altoNoString.xml b/Tests/Fixtures/Format/altoNoString.xml new file mode 100644 index 000000000..f3761291b --- /dev/null +++ b/Tests/Fixtures/Format/altoNoString.xml @@ -0,0 +1,59 @@ + + + + pixel + + + 2020-05-14 + + ABBYY + ABBYY FineReader Engine + 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/Fixtures/Format/altoNoTextBlock.xml b/Tests/Fixtures/Format/altoNoTextBlock.xml new file mode 100644 index 000000000..c03ea75d6 --- /dev/null +++ b/Tests/Fixtures/Format/altoNoTextBlock.xml @@ -0,0 +1,38 @@ + + + + pixel + + + 2020-05-14 + + ABBYY + ABBYY FineReader Engine + 12 + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/Fixtures/Format/altoNoTextLine.xml b/Tests/Fixtures/Format/altoNoTextLine.xml new file mode 100644 index 000000000..36fc3022f --- /dev/null +++ b/Tests/Fixtures/Format/altoNoTextLine.xml @@ -0,0 +1,48 @@ + + + + pixel + + + 2020-05-14 + + ABBYY + ABBYY FineReader Engine + 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/Fixtures/Format/audioVideo.xml b/Tests/Fixtures/Format/audioVideo.xml new file mode 100644 index 000000000..a949c0714 --- /dev/null +++ b/Tests/Fixtures/Format/audioVideo.xml @@ -0,0 +1,59 @@ + + + + + + + + + Color + + Phoenix Finish + Apple ProRes 4444 + + 24 + Yes + + + 1.375:1 + + 00:01:30.07 + + 24 + + + + + + + + + + + + 01:10:35.08 + + + + + + + + + + + + + + + + + + diff --git a/Tests/Fixtures/Format/modsAuthorNoAutRoleTerm.xml b/Tests/Fixtures/Format/modsAuthorNoAutRoleTerm.xml new file mode 100644 index 000000000..645502e81 --- /dev/null +++ b/Tests/Fixtures/Format/modsAuthorNoAutRoleTerm.xml @@ -0,0 +1,126 @@ + + + + Odol-Mundwasser, 3 Werbespots + + + + SAVE: Beispiel-Kollektion + + + + 2180770-X + + Stiftung Deutsches Hygiene-Museum + + oth + + + + AnonymousGiven1 AnonymousFamily1 + + + AnonymousGiven2 + AnonymousFamily2 + + Film + Werbefilm + + + Dresden + + SLUB + Filmverband Sachsen + Stiftung Deutsches Hygiene-Museum + 2019 + + + ger + + + positiv, farbig, 24 fps, Bildseitenverhältnis 1,375:1, 2048 px horizontal, Codec: Apple ProRes (HQ) + 4444, Container: Quicktime .mov + + access + video/quicktime + 1 Online-Ressource (1 min, 30 s) + reformatted digital + + [Inhaltsbeschreibung] + + + Odol-Mundwasser, 3 Werbespots + + + 2180770-X + + Stiftung Deutsches Hygiene-Museum + + oth + + + Film + Werbefilm + + + Dresden + + SLUB + Filmverband Sachsen + Stiftung Deutsches Hygiene-Museum + 1965 + 1975 + + + ger + + + Nativ-Scan mit Overscan, Videocodec FFV1 Version 3, Container: Matroska + preservation + video/quicktime + 1 Online-Ressource (1 min, 16 s) + digitized other analog + Acetat mit Lichtton, Umkehr-Positiv, farbig ; 16 mm + + Bearbeitete digitale Ausgabe eines Exemplars aus dem Bestand der Stiftung + Deutsches Hygiene-Museum Dresden + + Die Digitalisierung des Films erfolgte im Rahmen des Programms „Sicherung des + audiovisuellen Erbes in Sachsen“ des Filmverband Sachsen (2019) und der Sächsischen Landesbibliothek – + Staats- und Universitätsbibliothek Dresden in Kooperation mit: Stiftung Deutsches Hygiene-Museum Dresden, + gefördert durch: Sächsisches Staatsministerium für Wissenschaft und Kunst + + 1703800354 + + DE-14 + + Odol 2915 (Rolle 2) + + + 1703800435 + http://digital.slub-dresden.de/id1703800435 + urn:nbn:de:bsz:14-db-id17038004351 + + DE-14 + + https://digital.slub-dresden.de/id1703800435 + + + Public Domain Mark 1.0 + + Open Access + + + + + oai:de:slub-dresden:db:id-1703800435 + + + + diff --git a/Tests/Fixtures/Format/modsAuthorWithAutRoleTerm.xml b/Tests/Fixtures/Format/modsAuthorWithAutRoleTerm.xml new file mode 100644 index 000000000..2f6d26f8c --- /dev/null +++ b/Tests/Fixtures/Format/modsAuthorWithAutRoleTerm.xml @@ -0,0 +1,151 @@ + + + + + Jack + May + I + District Commissioner + Préfet de région + + aut + + + + + John Paul + II + Pope + 1920-2005 + + aut + + + + + Mattox + Douglas E. + 1947- + + aut + + + + + Woolf, Virginia + 1882-1941 + + aut + + + + + Alterman, Eric + Eric Alterman + + aut + + + + Film + Werbefilm + + + Dresden + + SLUB + Filmverband Sachsen + Stiftung Deutsches Hygiene-Museum + 2019 + + + + ger + + + positiv, farbig, 24 fps, Bildseitenverhältnis 1,375:1, 2048 px horizontal, Codec: Apple ProRes (HQ) + 4444, Container: Quicktime .mov + + access + video/quicktime + 1 Online-Ressource (1 min, 30 s) + reformatted digital + + [Inhaltsbeschreibung] + + + Odol-Mundwasser, 3 Werbespots + + + 2180770-X + + Stiftung Deutsches Hygiene-Museum + + oth + + + Film + Werbefilm + + + Dresden + + SLUB + Filmverband Sachsen + Stiftung Deutsches Hygiene-Museum + 1965 + 1975 + + + ger + + + Nativ-Scan mit Overscan, Videocodec FFV1 Version 3, Container: Matroska + preservation + video/quicktime + 1 Online-Ressource (1 min, 16 s) + digitized other analog + Acetat mit Lichtton, Umkehr-Positiv, farbig ; 16 mm + + Bearbeitete digitale Ausgabe eines Exemplars aus dem Bestand der Stiftung + Deutsches Hygiene-Museum Dresden + + Die Digitalisierung des Films erfolgte im Rahmen des Programms „Sicherung des + audiovisuellen Erbes in Sachsen“ des Filmverband Sachsen (2019) und der Sächsischen Landesbibliothek – + Staats- und Universitätsbibliothek Dresden in Kooperation mit: Stiftung Deutsches Hygiene-Museum Dresden, + gefördert durch: Sächsisches Staatsministerium für Wissenschaft und Kunst + + 1703800354 + + DE-14 + + Odol 2915 (Rolle 2) + + + 1703800435 + http://digital.slub-dresden.de/id1703800435 + urn:nbn:de:bsz:14-db-id17038004351 + + DE-14 + + https://digital.slub-dresden.de/id1703800435 + + + Public Domain Mark 1.0 + + Open Access + + + + + oai:de:slub-dresden:db:id-1703800435 + + + + diff --git a/Tests/Fixtures/Format/modsOriginInfo.xml b/Tests/Fixtures/Format/modsOriginInfo.xml new file mode 100644 index 000000000..987d3fd95 --- /dev/null +++ b/Tests/Fixtures/Format/modsOriginInfo.xml @@ -0,0 +1,134 @@ + + + + + Alterman, Eric + Eric Alterman + + aut + + + + Film + Werbefilm + + + Dresden + + SLUB + Filmverband Sachsen + Stiftung Deutsches Hygiene-Museum + 2019 + + + + + Hamburg + + 2018 + + + + + Berlin + + 2021 + + + + + München + + 2020 + + + + ger + + + positiv, farbig, 24 fps, Bildseitenverhältnis 1,375:1, 2048 px horizontal, Codec: Apple ProRes (HQ) + 4444, Container: Quicktime .mov + + access + video/quicktime + 1 Online-Ressource (1 min, 30 s) + reformatted digital + + [Inhaltsbeschreibung] + + + Odol-Mundwasser, 3 Werbespots + + + 2180770-X + + Stiftung Deutsches Hygiene-Museum + + oth + + + Film + Werbefilm + + + Dresden + + SLUB + Filmverband Sachsen + Stiftung Deutsches Hygiene-Museum + 1965 + 1975 + + + ger + + + Nativ-Scan mit Overscan, Videocodec FFV1 Version 3, Container: Matroska + preservation + video/quicktime + 1 Online-Ressource (1 min, 16 s) + digitized other analog + Acetat mit Lichtton, Umkehr-Positiv, farbig ; 16 mm + + Bearbeitete digitale Ausgabe eines Exemplars aus dem Bestand der Stiftung + Deutsches Hygiene-Museum Dresden + + Die Digitalisierung des Films erfolgte im Rahmen des Programms „Sicherung des + audiovisuellen Erbes in Sachsen“ des Filmverband Sachsen (2019) und der Sächsischen Landesbibliothek – + Staats- und Universitätsbibliothek Dresden in Kooperation mit: Stiftung Deutsches Hygiene-Museum Dresden, + gefördert durch: Sächsisches Staatsministerium für Wissenschaft und Kunst + + 1703800354 + + DE-14 + + Odol 2915 (Rolle 2) + + + 1703800435 + http://digital.slub-dresden.de/id1703800435 + urn:nbn:de:bsz:14-db-id17038004351 + + DE-14 + + https://digital.slub-dresden.de/id1703800435 + + + Public Domain Mark 1.0 + + Open Access + + + + + oai:de:slub-dresden:db:id-1703800435 + + + + diff --git a/Tests/Fixtures/Format/modsOriginInfoWithEditionElectonicEd.xml b/Tests/Fixtures/Format/modsOriginInfoWithEditionElectonicEd.xml new file mode 100644 index 000000000..d1f9ffe4f --- /dev/null +++ b/Tests/Fixtures/Format/modsOriginInfoWithEditionElectonicEd.xml @@ -0,0 +1,138 @@ + + + + + Alterman, Eric + Eric Alterman + + aut + + + + Film + Werbefilm + + + Dresden + + SLUB + Filmverband Sachsen + Stiftung Deutsches Hygiene-Museum + 2019 + [Electronic ed.] + + + + + Hamburg + + 2018 + [Electronic ed.] + + + + + Berlin + + 2021 + [Electronic ed.] + + + + + München + + 2020 + [Electronic ed.] + + + + ger + + + positiv, farbig, 24 fps, Bildseitenverhältnis 1,375:1, 2048 px horizontal, Codec: Apple ProRes (HQ) + 4444, Container: Quicktime .mov + + access + video/quicktime + 1 Online-Ressource (1 min, 30 s) + reformatted digital + + [Inhaltsbeschreibung] + + + Odol-Mundwasser, 3 Werbespots + + + 2180770-X + + Stiftung Deutsches Hygiene-Museum + + oth + + + Film + Werbefilm + + + Dresden + + SLUB + Filmverband Sachsen + Stiftung Deutsches Hygiene-Museum + 1965 + 1975 + + + ger + + + Nativ-Scan mit Overscan, Videocodec FFV1 Version 3, Container: Matroska + preservation + video/quicktime + 1 Online-Ressource (1 min, 16 s) + digitized other analog + Acetat mit Lichtton, Umkehr-Positiv, farbig ; 16 mm + + Bearbeitete digitale Ausgabe eines Exemplars aus dem Bestand der Stiftung + Deutsches Hygiene-Museum Dresden + + Die Digitalisierung des Films erfolgte im Rahmen des Programms „Sicherung des + audiovisuellen Erbes in Sachsen“ des Filmverband Sachsen (2019) und der Sächsischen Landesbibliothek – + Staats- und Universitätsbibliothek Dresden in Kooperation mit: Stiftung Deutsches Hygiene-Museum Dresden, + gefördert durch: Sächsisches Staatsministerium für Wissenschaft und Kunst + + 1703800354 + + DE-14 + + Odol 2915 (Rolle 2) + + + 1703800435 + http://digital.slub-dresden.de/id1703800435 + urn:nbn:de:bsz:14-db-id17038004351 + + DE-14 + + https://digital.slub-dresden.de/id1703800435 + + + Public Domain Mark 1.0 + + Open Access + + + + + oai:de:slub-dresden:db:id-1703800435 + + + + diff --git a/Tests/Unit/Format/AltoTest.php b/Tests/Unit/Format/AltoTest.php new file mode 100644 index 000000000..2eaf12e72 --- /dev/null +++ b/Tests/Unit/Format/AltoTest.php @@ -0,0 +1,106 @@ +getRawText($xml); + + $this->assertEquals('Bürgertum und Bürgerlichkeit in Dresden DRESDNER HEFTE', $rawText); + } + + /** + * @test + * @group extract data + */ + public function getTextAsMiniOcr(): void + { + $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/alto.xml'); + $alto = new Alto(); + + $rawText = $alto->getTextAsMiniOcr($xml); + + $miniOCR = << + + + Bürgertum + und + + + Bürgerlichkeit + in + Dresden + + + + + DRESDNER + + + HEFTE + + + + XML; + + $this->assertXmlStringEqualsXmlString($miniOCR, $rawText); + } + + /** + * @test + * @group extract data + */ + public function getTextAsMiniOcrNoTextBlock(): void + { + $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/altoNoTextBlock.xml'); + $alto = new Alto(); + + $rawText = $alto->getTextAsMiniOcr($xml); + + $this->assertEquals('', $rawText); + } + + /** + * @test + * @group extract data + */ + public function getTextAsMiniOcrNoTextline(): void + { + $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/altoNoTextLine.xml'); + $alto = new Alto(); + + $rawText = $alto->getTextAsMiniOcr($xml); + + $this->assertXmlStringEqualsXmlString('', $rawText); + } + + /** + * @test + * @group extract data + */ + public function getTextAsMiniOcrNoString(): void + { + $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/altoNoString.xml'); + $alto = new Alto(); + + $rawText = $alto->getTextAsMiniOcr($xml); + + $this->assertXmlStringEqualsXmlString( + '', + $rawText + ); + } +} diff --git a/Tests/Unit/Format/AudioVideoMDTest.php b/Tests/Unit/Format/AudioVideoMDTest.php new file mode 100644 index 000000000..bc4d5b021 --- /dev/null +++ b/Tests/Unit/Format/AudioVideoMDTest.php @@ -0,0 +1,109 @@ +metadata = [ + 'duration' => [], + 'video_duration' => [], + 'audio_duration' => [] + ]; + } + + /** + * @test + * @group extractMetadata + */ + public function canExtractVideoDuration(): void + { + $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/audioVideo.xml'); + $audioVideoMD = new AudioVideoMD(); + + $videoXml = $xml->xpath('//videomd:VIDEOMD')[0]; + + $audioVideoMD->extractMetadata($videoXml,$this->metadata); + + $this->assertEquals( + ["00:01:30.07"], + $this->metadata['duration'] + ); + + $this->assertEquals( + ["00:01:30.07"], + $this->metadata['video_duration'] + ); + + $this->assertEquals( + [], + $this->metadata['audio_duration'] + ); + } + + /** + * @test + * @group extractMetadata + */ + public function canExtractAudioDuration(): void + { + $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/audioVideo.xml'); + $audioVideoMD = new AudioVideoMD(); + + $audioXml = $xml->xpath('//audiomd:AUDIOMD')[0]; + + $audioVideoMD->extractMetadata($audioXml,$this->metadata); + + $this->assertEquals( + ["01:10:35.08"], + $this->metadata['duration'] + ); + + $this->assertEquals( + [], + $this->metadata['video_duration'] + ); + + $this->assertEquals( + ["01:10:35.08"], + $this->metadata['audio_duration'] + ); + } + + /** + * @test + * @group extractMetadata + */ + public function noDuration(): void + { + $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/audioVideo.xml'); + $audioVideoMD = new AudioVideoMD(); + + $videoXml = $xml->xpath('//audiomd:AUDIOMD')[1]; + + $audioVideoMD->extractMetadata($videoXml,$this->metadata); + + $this->assertEquals( + [], + $this->metadata['duration'] + ); + + $this->assertEquals( + [], + $this->metadata['audio_duration'] + ); + + $this->assertEquals( + [], + $this->metadata['video_duration'] + ); + } +} diff --git a/Tests/Unit/Format/ModsTest.php b/Tests/Unit/Format/ModsTest.php new file mode 100644 index 000000000..af9d016cb --- /dev/null +++ b/Tests/Unit/Format/ModsTest.php @@ -0,0 +1,204 @@ +metadata = [ + 'title' => [], + 'title_sorting' => [], + 'author' => [], + 'place' => [], + 'place_sorting' => [0 => []], + 'year' => [], + 'prod_id' => [], + 'record_id' => [], + 'opac_id' => [], + 'union_id' => [], + 'urn' => [], + 'purl' => [], + 'type' => [], + 'volume' => [], + 'volume_sorting' => [], + 'license' => [], + 'terms' => [], + 'restrictions' => [], + 'out_of_print' => [], + 'rights_info' => [], + 'collection' => [], + 'owner' => [], + 'mets_label' => [], + 'mets_orderlabel' => [], + 'document_format' => ['METS'], + 'year_sorting' => [0 => []], + ]; + + } + + /** + * @test + * @group extractMetadata + */ + public function extractAuthorsIfNoAutRoleTermAssigned(): void + { + $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/modsAuthorNoAutRoleTerm.xml'); + $mods = new Mods(); + + $mods->extractMetadata($xml,$this->metadata); + + $this->assertEquals( + [ + "AnonymousGiven1 AnonymousFamily1", + "AnonymousFamily2, AnonymousGiven2" + ], + $this->metadata['author'] + ); + } + + /** + * @test + * @group extractMetadata + */ + public function extractAuthorsWithAutRoleTermAssigned(): void + { + $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/modsAuthorWithAutRoleTerm.xml'); + $mods = new Mods(); + + $mods->extractMetadata($xml,$this->metadata); + $this->assertEquals( + [ + 'May, Jack, I', + 'John Paul, Pope, 1920-2005', + 'Mattox, Douglas E., 1947-', + '1882-1941, Woolf, Virginia', + 'Eric Alterman' + ], + $this->metadata['author'] + ); + } + + /** + * @test + * @group extractMetadata + */ + public function extractPlaces(): void + { + $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/modsOriginInfo.xml'); + $mods = new Mods(); + + $mods->extractMetadata($xml,$this->metadata); + + $this->assertEquals( + [ + "Dresden", + "Hamburg", + "Berlin", + "München", + ], + $this->metadata['place'] + ); + + $this->assertEquals( + [ + "Dresden", + ], + $this->metadata['place_sorting'] + ); + } + + /** + * @test + * @group extractMetadata + */ + public function extractYears(): void + { + $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/modsOriginInfo.xml'); + $mods = new Mods(); + + $mods->extractMetadata($xml,$this->metadata); + + $this->assertEquals( + [ + "2019", + "2018", + "2021", + "2020", + ], + $this->metadata['year'] + ); + + $this->assertEquals( + [ + "2019", + ], + $this->metadata['year_sorting'] + ); + } + + /** + * @test + * @group extractMetadata + */ + public function extractPlacesWithElectronicEdInside(): void + { + $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/modsOriginInfoWithEditionElectonicEd.xml'); + $mods = new Mods(); + + $mods->extractMetadata($xml,$this->metadata); + + $this->assertEquals( + [ + "Dresden", + "Hamburg", + "Berlin", + "München", + ], + $this->metadata['place'] + ); + + $this->assertEquals( + [ + "Dresden", + ], + $this->metadata['place_sorting'] + ); + } + + /** + * @test + * @group extractMetadata + */ + public function extractYearsWithElectronicEdInside(): void + { + $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/modsOriginInfoWithEditionElectonicEd.xml'); + $mods = new Mods(); + + $mods->extractMetadata($xml,$this->metadata); + + $this->assertEquals( + [ + "2019", + "2018", + "2021", + "2020", + ], + $this->metadata['year'] + ); + + $this->assertEquals( + [ + "2019", + ], + $this->metadata['year_sorting'] + ); + } +} diff --git a/Tests/Unit/Format/TeiHeaderTest.php b/Tests/Unit/Format/TeiHeaderTest.php new file mode 100644 index 000000000..c6a1a3e2c --- /dev/null +++ b/Tests/Unit/Format/TeiHeaderTest.php @@ -0,0 +1,30 @@ +metadata = []; + } + + /** + * @test + * @group extractMetadata + */ + public function extract(): void + { + $teiHeader = new TeiHeader(); + //$teiHeader->extractMetadata(); + //TODO: TeiHeader class not fully implemented. + $this->assertTrue(false); + } +} From c0c8b86601f26c3baa0bd313702bb79a459f1a16 Mon Sep 17 00:00:00 2001 From: haogatyp Date: Mon, 30 Jan 2023 11:08:03 +0100 Subject: [PATCH 2/8] Fix unused local variable. --- Tests/Unit/Format/TeiHeaderTest.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Tests/Unit/Format/TeiHeaderTest.php b/Tests/Unit/Format/TeiHeaderTest.php index c6a1a3e2c..e987ce345 100644 --- a/Tests/Unit/Format/TeiHeaderTest.php +++ b/Tests/Unit/Format/TeiHeaderTest.php @@ -22,9 +22,7 @@ public function setUp(): void */ public function extract(): void { - $teiHeader = new TeiHeader(); - //$teiHeader->extractMetadata(); - //TODO: TeiHeader class not fully implemented. + //TODO: TeiHeader class has no usefull implementation. $this->assertTrue(false); } } From e4d44263a4bdba84c365d9a4ac29efb116664d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6hr?= Date: Wed, 25 Oct 2023 17:29:44 +0200 Subject: [PATCH 3/8] Skip test for class not implemented --- Tests/Unit/Format/TeiHeaderTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Unit/Format/TeiHeaderTest.php b/Tests/Unit/Format/TeiHeaderTest.php index e987ce345..dea6d9a63 100644 --- a/Tests/Unit/Format/TeiHeaderTest.php +++ b/Tests/Unit/Format/TeiHeaderTest.php @@ -22,7 +22,7 @@ public function setUp(): void */ public function extract(): void { - //TODO: TeiHeader class has no usefull implementation. - $this->assertTrue(false); + //TODO: TeiHeader class has no useful implementation. + $this->markTestSkipped('Implement test when TeiHeader class is implemented.'); } } From 27b2db10d722c73978da4f3ef9e7781d1da99786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6hr?= Date: Wed, 25 Oct 2023 17:34:46 +0200 Subject: [PATCH 4/8] Fix AudioVideoMDTest --- Tests/Fixtures/Format/audioVideo.xml | 71 ++++++++-------------- Tests/Unit/Format/AudioVideoMDTest.php | 82 +++----------------------- 2 files changed, 33 insertions(+), 120 deletions(-) diff --git a/Tests/Fixtures/Format/audioVideo.xml b/Tests/Fixtures/Format/audioVideo.xml index a949c0714..f4eb1b941 100644 --- a/Tests/Fixtures/Format/audioVideo.xml +++ b/Tests/Fixtures/Format/audioVideo.xml @@ -8,52 +8,29 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/METS/ http://www.loc.gov/standards/mets/mets.xsd http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/mods.xsd http://www.loc.gov/videoMD/ https://www.loc.gov/standards/amdvmd/videoMD.xsd"> - - - - - - Color - - Phoenix Finish - Apple ProRes 4444 - - 24 - Yes - - - 1.375:1 - - 00:01:30.07 - - 24 - - - - - - - - - - - - 01:10:35.08 - - - - - - - - - - - - - - - - + + + + Color + + Phoenix Finish + Apple ProRes 4444 + + 24 + Yes + + + 1.375:1 + + 00:01:30.07 + + 24 + + + + 01:10:35.08 + + + diff --git a/Tests/Unit/Format/AudioVideoMDTest.php b/Tests/Unit/Format/AudioVideoMDTest.php index bc4d5b021..c4ea078ff 100644 --- a/Tests/Unit/Format/AudioVideoMDTest.php +++ b/Tests/Unit/Format/AudioVideoMDTest.php @@ -5,7 +5,7 @@ use Kitodo\Dlf\Format\AudioVideoMD; use TYPO3\TestingFramework\Core\Unit\UnitTestCase; -class AudioVideaoMDTest extends UnitTestCase +class AudioVideoMDTest extends UnitTestCase { protected $metadata = []; @@ -24,86 +24,22 @@ public function setUp(): void * @test * @group extractMetadata */ - public function canExtractVideoDuration(): void + public function canExtractDuration(): void { $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/audioVideo.xml'); $audioVideoMD = new AudioVideoMD(); - $videoXml = $xml->xpath('//videomd:VIDEOMD')[0]; + $videoXml = $xml->xpath('//mets:xmlData')[0]; $audioVideoMD->extractMetadata($videoXml,$this->metadata); $this->assertEquals( - ["00:01:30.07"], - $this->metadata['duration'] - ); - - $this->assertEquals( - ["00:01:30.07"], - $this->metadata['video_duration'] - ); - - $this->assertEquals( - [], - $this->metadata['audio_duration'] - ); - } - - /** - * @test - * @group extractMetadata - */ - public function canExtractAudioDuration(): void - { - $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/audioVideo.xml'); - $audioVideoMD = new AudioVideoMD(); - - $audioXml = $xml->xpath('//audiomd:AUDIOMD')[0]; - - $audioVideoMD->extractMetadata($audioXml,$this->metadata); - - $this->assertEquals( - ["01:10:35.08"], - $this->metadata['duration'] - ); - - $this->assertEquals( - [], - $this->metadata['video_duration'] - ); - - $this->assertEquals( - ["01:10:35.08"], - $this->metadata['audio_duration'] - ); - } - - /** - * @test - * @group extractMetadata - */ - public function noDuration(): void - { - $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/audioVideo.xml'); - $audioVideoMD = new AudioVideoMD(); - - $videoXml = $xml->xpath('//audiomd:AUDIOMD')[1]; - - $audioVideoMD->extractMetadata($videoXml,$this->metadata); - - $this->assertEquals( - [], - $this->metadata['duration'] - ); - - $this->assertEquals( - [], - $this->metadata['audio_duration'] - ); - - $this->assertEquals( - [], - $this->metadata['video_duration'] + [ + 'duration' => ["00:01:30.07"], + 'video_duration' => ["00:01:30.07"], + 'audio_duration' => ["01:10:35.08"] + ], + $this->metadata ); } } From c04d9d3028de71a5c1f2aad18977dff1204a1067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6hr?= Date: Wed, 25 Oct 2023 17:36:22 +0200 Subject: [PATCH 5/8] Fix ModsTest --- Tests/Unit/Format/ModsTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Tests/Unit/Format/ModsTest.php b/Tests/Unit/Format/ModsTest.php index af9d016cb..937920b71 100644 --- a/Tests/Unit/Format/ModsTest.php +++ b/Tests/Unit/Format/ModsTest.php @@ -53,7 +53,7 @@ public function extractAuthorsIfNoAutRoleTermAssigned(): void $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/modsAuthorNoAutRoleTerm.xml'); $mods = new Mods(); - $mods->extractMetadata($xml,$this->metadata); + $mods->extractMetadata($xml,$this->metadata, false); $this->assertEquals( [ @@ -73,7 +73,7 @@ public function extractAuthorsWithAutRoleTermAssigned(): void $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/modsAuthorWithAutRoleTerm.xml'); $mods = new Mods(); - $mods->extractMetadata($xml,$this->metadata); + $mods->extractMetadata($xml,$this->metadata, false); $this->assertEquals( [ 'May, Jack, I', @@ -95,7 +95,7 @@ public function extractPlaces(): void $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/modsOriginInfo.xml'); $mods = new Mods(); - $mods->extractMetadata($xml,$this->metadata); + $mods->extractMetadata($xml,$this->metadata, false); $this->assertEquals( [ @@ -124,7 +124,7 @@ public function extractYears(): void $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/modsOriginInfo.xml'); $mods = new Mods(); - $mods->extractMetadata($xml,$this->metadata); + $mods->extractMetadata($xml,$this->metadata, false); $this->assertEquals( [ @@ -153,7 +153,7 @@ public function extractPlacesWithElectronicEdInside(): void $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/modsOriginInfoWithEditionElectonicEd.xml'); $mods = new Mods(); - $mods->extractMetadata($xml,$this->metadata); + $mods->extractMetadata($xml,$this->metadata, false); $this->assertEquals( [ @@ -182,7 +182,7 @@ public function extractYearsWithElectronicEdInside(): void $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/modsOriginInfoWithEditionElectonicEd.xml'); $mods = new Mods(); - $mods->extractMetadata($xml,$this->metadata); + $mods->extractMetadata($xml,$this->metadata, false); $this->assertEquals( [ From a02348247810492ef7c938acb01a7f8b1942a25b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6hr?= Date: Wed, 25 Oct 2023 17:55:49 +0200 Subject: [PATCH 6/8] Fix AltoTest --- Tests/Fixtures/Format/alto.xml | 128 +++++++++++----------- Tests/Fixtures/Format/altoNoString.xml | 114 +++++++++---------- Tests/Fixtures/Format/altoNoTextBlock.xml | 72 ++++++------ Tests/Fixtures/Format/altoNoTextLine.xml | 92 ++++++++-------- 4 files changed, 203 insertions(+), 203 deletions(-) diff --git a/Tests/Fixtures/Format/alto.xml b/Tests/Fixtures/Format/alto.xml index 770fc554f..3cc47e12e 100644 --- a/Tests/Fixtures/Format/alto.xml +++ b/Tests/Fixtures/Format/alto.xml @@ -1,66 +1,66 @@ - - - pixel - - - 2020-05-14 - - ABBYY - ABBYY FineReader Engine - 12 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + xmlns="http://www.loc.gov/standards/alto/ns-v2#"> + + pixel + + + 2020-05-14 + + ABBYY + ABBYY FineReader Engine + 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/Fixtures/Format/altoNoString.xml b/Tests/Fixtures/Format/altoNoString.xml index f3761291b..7cde52caf 100644 --- a/Tests/Fixtures/Format/altoNoString.xml +++ b/Tests/Fixtures/Format/altoNoString.xml @@ -1,59 +1,59 @@ - - - pixel - - - 2020-05-14 - - ABBYY - ABBYY FineReader Engine - 12 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + xmlns="http://www.loc.gov/standards/alto/ns-v2#"> + + pixel + + + 2020-05-14 + + ABBYY + ABBYY FineReader Engine + 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/Fixtures/Format/altoNoTextBlock.xml b/Tests/Fixtures/Format/altoNoTextBlock.xml index c03ea75d6..e10292809 100644 --- a/Tests/Fixtures/Format/altoNoTextBlock.xml +++ b/Tests/Fixtures/Format/altoNoTextBlock.xml @@ -1,38 +1,38 @@ - - - pixel - - - 2020-05-14 - - ABBYY - ABBYY FineReader Engine - 12 - - - - - - - - - - - - - - - - - - - - - - - - - + xmlns="http://www.loc.gov/standards/alto/ns-v2#"> + + pixel + + + 2020-05-14 + + ABBYY + ABBYY FineReader Engine + 12 + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/Fixtures/Format/altoNoTextLine.xml b/Tests/Fixtures/Format/altoNoTextLine.xml index 36fc3022f..5468cf712 100644 --- a/Tests/Fixtures/Format/altoNoTextLine.xml +++ b/Tests/Fixtures/Format/altoNoTextLine.xml @@ -1,48 +1,48 @@ - - - pixel - - - 2020-05-14 - - ABBYY - ABBYY FineReader Engine - 12 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + xmlns="http://www.loc.gov/standards/alto/ns-v2#"> + + pixel + + + 2020-05-14 + + ABBYY + ABBYY FineReader Engine + 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 0488d7ad6d895ac43c113e4e805b543f4daa098b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6hr?= Date: Thu, 26 Oct 2023 07:21:27 +0200 Subject: [PATCH 7/8] Fix code style --- Tests/Unit/Format/AltoTest.php | 10 +++++----- Tests/Unit/Format/AudioVideoMDTest.php | 4 ++-- Tests/Unit/Format/ModsTest.php | 24 ++++++++++++------------ Tests/Unit/Format/TeiHeaderTest.php | 1 - 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/Tests/Unit/Format/AltoTest.php b/Tests/Unit/Format/AltoTest.php index 2eaf12e72..16b535a7f 100644 --- a/Tests/Unit/Format/AltoTest.php +++ b/Tests/Unit/Format/AltoTest.php @@ -13,7 +13,7 @@ class AltoTest extends UnitTestCase */ public function getRawData(): void { - $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/alto.xml'); + $xml = simplexml_load_file(__DIR__ . '/../../Fixtures/Format/alto.xml'); $alto = new Alto(); $rawText = $alto->getRawText($xml); @@ -27,7 +27,7 @@ public function getRawData(): void */ public function getTextAsMiniOcr(): void { - $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/alto.xml'); + $xml = simplexml_load_file(__DIR__ . '/../../Fixtures/Format/alto.xml'); $alto = new Alto(); $rawText = $alto->getTextAsMiniOcr($xml); @@ -65,7 +65,7 @@ public function getTextAsMiniOcr(): void */ public function getTextAsMiniOcrNoTextBlock(): void { - $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/altoNoTextBlock.xml'); + $xml = simplexml_load_file(__DIR__ . '/../../Fixtures/Format/altoNoTextBlock.xml'); $alto = new Alto(); $rawText = $alto->getTextAsMiniOcr($xml); @@ -79,7 +79,7 @@ public function getTextAsMiniOcrNoTextBlock(): void */ public function getTextAsMiniOcrNoTextline(): void { - $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/altoNoTextLine.xml'); + $xml = simplexml_load_file(__DIR__ . '/../../Fixtures/Format/altoNoTextLine.xml'); $alto = new Alto(); $rawText = $alto->getTextAsMiniOcr($xml); @@ -93,7 +93,7 @@ public function getTextAsMiniOcrNoTextline(): void */ public function getTextAsMiniOcrNoString(): void { - $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/altoNoString.xml'); + $xml = simplexml_load_file(__DIR__ . '/../../Fixtures/Format/altoNoString.xml'); $alto = new Alto(); $rawText = $alto->getTextAsMiniOcr($xml); diff --git a/Tests/Unit/Format/AudioVideoMDTest.php b/Tests/Unit/Format/AudioVideoMDTest.php index c4ea078ff..0504c6c06 100644 --- a/Tests/Unit/Format/AudioVideoMDTest.php +++ b/Tests/Unit/Format/AudioVideoMDTest.php @@ -26,12 +26,12 @@ public function setUp(): void */ public function canExtractDuration(): void { - $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/audioVideo.xml'); + $xml = simplexml_load_file(__DIR__ . '/../../Fixtures/Format/audioVideo.xml'); $audioVideoMD = new AudioVideoMD(); $videoXml = $xml->xpath('//mets:xmlData')[0]; - $audioVideoMD->extractMetadata($videoXml,$this->metadata); + $audioVideoMD->extractMetadata($videoXml, $this->metadata); $this->assertEquals( [ diff --git a/Tests/Unit/Format/ModsTest.php b/Tests/Unit/Format/ModsTest.php index 937920b71..656b0b960 100644 --- a/Tests/Unit/Format/ModsTest.php +++ b/Tests/Unit/Format/ModsTest.php @@ -50,10 +50,10 @@ public function setUp(): void */ public function extractAuthorsIfNoAutRoleTermAssigned(): void { - $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/modsAuthorNoAutRoleTerm.xml'); + $xml = simplexml_load_file(__DIR__ . '/../../Fixtures/Format/modsAuthorNoAutRoleTerm.xml'); $mods = new Mods(); - $mods->extractMetadata($xml,$this->metadata, false); + $mods->extractMetadata($xml, $this->metadata, false); $this->assertEquals( [ @@ -70,10 +70,10 @@ public function extractAuthorsIfNoAutRoleTermAssigned(): void */ public function extractAuthorsWithAutRoleTermAssigned(): void { - $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/modsAuthorWithAutRoleTerm.xml'); + $xml = simplexml_load_file(__DIR__ . '/../../Fixtures/Format/modsAuthorWithAutRoleTerm.xml'); $mods = new Mods(); - $mods->extractMetadata($xml,$this->metadata, false); + $mods->extractMetadata($xml, $this->metadata, false); $this->assertEquals( [ 'May, Jack, I', @@ -92,10 +92,10 @@ public function extractAuthorsWithAutRoleTermAssigned(): void */ public function extractPlaces(): void { - $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/modsOriginInfo.xml'); + $xml = simplexml_load_file(__DIR__ . '/../../Fixtures/Format/modsOriginInfo.xml'); $mods = new Mods(); - $mods->extractMetadata($xml,$this->metadata, false); + $mods->extractMetadata($xml, $this->metadata, false); $this->assertEquals( [ @@ -121,10 +121,10 @@ public function extractPlaces(): void */ public function extractYears(): void { - $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/modsOriginInfo.xml'); + $xml = simplexml_load_file(__DIR__ . '/../../Fixtures/Format/modsOriginInfo.xml'); $mods = new Mods(); - $mods->extractMetadata($xml,$this->metadata, false); + $mods->extractMetadata($xml, $this->metadata, false); $this->assertEquals( [ @@ -150,10 +150,10 @@ public function extractYears(): void */ public function extractPlacesWithElectronicEdInside(): void { - $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/modsOriginInfoWithEditionElectonicEd.xml'); + $xml = simplexml_load_file(__DIR__ . '/../../Fixtures/Format/modsOriginInfoWithEditionElectonicEd.xml'); $mods = new Mods(); - $mods->extractMetadata($xml,$this->metadata, false); + $mods->extractMetadata($xml, $this->metadata, false); $this->assertEquals( [ @@ -179,10 +179,10 @@ public function extractPlacesWithElectronicEdInside(): void */ public function extractYearsWithElectronicEdInside(): void { - $xml = simplexml_load_file( __DIR__ . '/../../Fixtures/Format/modsOriginInfoWithEditionElectonicEd.xml'); + $xml = simplexml_load_file(__DIR__ . '/../../Fixtures/Format/modsOriginInfoWithEditionElectonicEd.xml'); $mods = new Mods(); - $mods->extractMetadata($xml,$this->metadata, false); + $mods->extractMetadata($xml, $this->metadata, false); $this->assertEquals( [ diff --git a/Tests/Unit/Format/TeiHeaderTest.php b/Tests/Unit/Format/TeiHeaderTest.php index dea6d9a63..c802e953e 100644 --- a/Tests/Unit/Format/TeiHeaderTest.php +++ b/Tests/Unit/Format/TeiHeaderTest.php @@ -2,7 +2,6 @@ namespace Kitodo\Dlf\Tests\Unit\Format; -use Kitodo\Dlf\Format\TeiHeader ; use TYPO3\TestingFramework\Core\Unit\UnitTestCase; class TeiHeaderTest extends UnitTestCase From 68e00998d5627e5b02d675f46f0fea0e810eea96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6hr?= Date: Thu, 26 Oct 2023 07:50:39 +0200 Subject: [PATCH 8/8] Add license and fix typo --- ...l => modsOriginInfoWithEditionElectronicEd.xml} | 0 Tests/Unit/Format/AltoTest.php | 10 ++++++++++ Tests/Unit/Format/AudioVideoMDTest.php | 10 ++++++++++ Tests/Unit/Format/ModsTest.php | 14 ++++++++++++-- Tests/Unit/Format/TeiHeaderTest.php | 10 ++++++++++ 5 files changed, 42 insertions(+), 2 deletions(-) rename Tests/Fixtures/Format/{modsOriginInfoWithEditionElectonicEd.xml => modsOriginInfoWithEditionElectronicEd.xml} (100%) diff --git a/Tests/Fixtures/Format/modsOriginInfoWithEditionElectonicEd.xml b/Tests/Fixtures/Format/modsOriginInfoWithEditionElectronicEd.xml similarity index 100% rename from Tests/Fixtures/Format/modsOriginInfoWithEditionElectonicEd.xml rename to Tests/Fixtures/Format/modsOriginInfoWithEditionElectronicEd.xml diff --git a/Tests/Unit/Format/AltoTest.php b/Tests/Unit/Format/AltoTest.php index 16b535a7f..89d8655d9 100644 --- a/Tests/Unit/Format/AltoTest.php +++ b/Tests/Unit/Format/AltoTest.php @@ -1,5 +1,15 @@ + * + * This file is part of the Kitodo and TYPO3 projects. + * + * @license GNU General Public License version 3 or later. + * For the full copyright and license information, please read the + * LICENSE.txt file that was distributed with this source code. + */ + namespace Kitodo\Dlf\Tests\Unit\Format; use Kitodo\Dlf\Format\Alto; diff --git a/Tests/Unit/Format/AudioVideoMDTest.php b/Tests/Unit/Format/AudioVideoMDTest.php index 0504c6c06..6fe510e5d 100644 --- a/Tests/Unit/Format/AudioVideoMDTest.php +++ b/Tests/Unit/Format/AudioVideoMDTest.php @@ -1,5 +1,15 @@ + * + * This file is part of the Kitodo and TYPO3 projects. + * + * @license GNU General Public License version 3 or later. + * For the full copyright and license information, please read the + * LICENSE.txt file that was distributed with this source code. + */ + namespace Kitodo\Dlf\Tests\Unit\Format; use Kitodo\Dlf\Format\AudioVideoMD; diff --git a/Tests/Unit/Format/ModsTest.php b/Tests/Unit/Format/ModsTest.php index 656b0b960..84f23172d 100644 --- a/Tests/Unit/Format/ModsTest.php +++ b/Tests/Unit/Format/ModsTest.php @@ -1,5 +1,15 @@ + * + * This file is part of the Kitodo and TYPO3 projects. + * + * @license GNU General Public License version 3 or later. + * For the full copyright and license information, please read the + * LICENSE.txt file that was distributed with this source code. + */ + namespace Kitodo\Dlf\Tests\Unit\Format; use Kitodo\Dlf\Format\Mods; @@ -150,7 +160,7 @@ public function extractYears(): void */ public function extractPlacesWithElectronicEdInside(): void { - $xml = simplexml_load_file(__DIR__ . '/../../Fixtures/Format/modsOriginInfoWithEditionElectonicEd.xml'); + $xml = simplexml_load_file(__DIR__ . '/../../Fixtures/Format/modsOriginInfoWithEditionElectronicEd.xml'); $mods = new Mods(); $mods->extractMetadata($xml, $this->metadata, false); @@ -179,7 +189,7 @@ public function extractPlacesWithElectronicEdInside(): void */ public function extractYearsWithElectronicEdInside(): void { - $xml = simplexml_load_file(__DIR__ . '/../../Fixtures/Format/modsOriginInfoWithEditionElectonicEd.xml'); + $xml = simplexml_load_file(__DIR__ . '/../../Fixtures/Format/modsOriginInfoWithEditionElectronicEd.xml'); $mods = new Mods(); $mods->extractMetadata($xml, $this->metadata, false); diff --git a/Tests/Unit/Format/TeiHeaderTest.php b/Tests/Unit/Format/TeiHeaderTest.php index c802e953e..38cf2d572 100644 --- a/Tests/Unit/Format/TeiHeaderTest.php +++ b/Tests/Unit/Format/TeiHeaderTest.php @@ -1,5 +1,15 @@ + * + * This file is part of the Kitodo and TYPO3 projects. + * + * @license GNU General Public License version 3 or later. + * For the full copyright and license information, please read the + * LICENSE.txt file that was distributed with this source code. + */ + namespace Kitodo\Dlf\Tests\Unit\Format; use TYPO3\TestingFramework\Core\Unit\UnitTestCase;