@@ -36,7 +36,7 @@ |
||
36 | 36 | */ |
37 | 37 | public function canExtractDuration(): void |
38 | 38 | { |
39 | - $xml = simplexml_load_file(__DIR__ . '/../../Fixtures/Format/audioVideo.xml'); |
|
39 | + $xml = simplexml_load_file(__DIR__.'/../../Fixtures/Format/audioVideo.xml'); |
|
40 | 40 | $audioVideoMD = new AudioVideoMD(); |
41 | 41 | |
42 | 42 | $videoXml = $xml->xpath('//mets:xmlData')[0]; |
@@ -15,8 +15,7 @@ |
||
15 | 15 | use Kitodo\Dlf\Format\AudioVideoMD; |
16 | 16 | use TYPO3\TestingFramework\Core\Unit\UnitTestCase; |
17 | 17 | |
18 | -class AudioVideoMDTest extends UnitTestCase |
|
19 | -{ |
|
18 | +class AudioVideoMDTest extends UnitTestCase { |
|
20 | 19 | protected $metadata = []; |
21 | 20 | |
22 | 21 | public function setUp(): void |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public function getRawData(): void |
25 | 25 | { |
26 | - $xml = simplexml_load_file(__DIR__ . '/../../Fixtures/Format/alto.xml'); |
|
26 | + $xml = simplexml_load_file(__DIR__.'/../../Fixtures/Format/alto.xml'); |
|
27 | 27 | $alto = new Alto(); |
28 | 28 | |
29 | 29 | $rawText = $alto->getRawText($xml); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function getTextAsMiniOcr(): void |
39 | 39 | { |
40 | - $xml = simplexml_load_file(__DIR__ . '/../../Fixtures/Format/alto.xml'); |
|
40 | + $xml = simplexml_load_file(__DIR__.'/../../Fixtures/Format/alto.xml'); |
|
41 | 41 | $alto = new Alto(); |
42 | 42 | |
43 | 43 | $rawText = $alto->getTextAsMiniOcr($xml); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function getTextAsMiniOcrNoTextBlock(): void |
77 | 77 | { |
78 | - $xml = simplexml_load_file(__DIR__ . '/../../Fixtures/Format/altoNoTextBlock.xml'); |
|
78 | + $xml = simplexml_load_file(__DIR__.'/../../Fixtures/Format/altoNoTextBlock.xml'); |
|
79 | 79 | $alto = new Alto(); |
80 | 80 | |
81 | 81 | $rawText = $alto->getTextAsMiniOcr($xml); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function getTextAsMiniOcrNoTextline(): void |
91 | 91 | { |
92 | - $xml = simplexml_load_file(__DIR__ . '/../../Fixtures/Format/altoNoTextLine.xml'); |
|
92 | + $xml = simplexml_load_file(__DIR__.'/../../Fixtures/Format/altoNoTextLine.xml'); |
|
93 | 93 | $alto = new Alto(); |
94 | 94 | |
95 | 95 | $rawText = $alto->getTextAsMiniOcr($xml); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function getTextAsMiniOcrNoString(): void |
105 | 105 | { |
106 | - $xml = simplexml_load_file(__DIR__ . '/../../Fixtures/Format/altoNoString.xml'); |
|
106 | + $xml = simplexml_load_file(__DIR__.'/../../Fixtures/Format/altoNoString.xml'); |
|
107 | 107 | $alto = new Alto(); |
108 | 108 | |
109 | 109 | $rawText = $alto->getTextAsMiniOcr($xml); |
@@ -15,8 +15,7 @@ |
||
15 | 15 | use Kitodo\Dlf\Format\Alto; |
16 | 16 | use TYPO3\TestingFramework\Core\Unit\UnitTestCase; |
17 | 17 | |
18 | -class AltoTest extends UnitTestCase |
|
19 | -{ |
|
18 | +class AltoTest extends UnitTestCase { |
|
20 | 19 | /** |
21 | 20 | * @test |
22 | 21 | * @group extract data |
@@ -14,8 +14,7 @@ |
||
14 | 14 | |
15 | 15 | use TYPO3\TestingFramework\Core\Unit\UnitTestCase; |
16 | 16 | |
17 | -class TeiHeaderTest extends UnitTestCase |
|
18 | -{ |
|
17 | +class TeiHeaderTest extends UnitTestCase { |
|
19 | 18 | protected $metadata = []; |
20 | 19 | |
21 | 20 | public function setUp(): void |
@@ -15,10 +15,8 @@ |
||
15 | 15 | use Kitodo\Dlf\Common\Helper; |
16 | 16 | use TYPO3\TestingFramework\Core\Unit\UnitTestCase; |
17 | 17 | |
18 | -class HelperTest extends UnitTestCase |
|
19 | -{ |
|
20 | - public function assertInvalidXml($xml) |
|
21 | - { |
|
18 | +class HelperTest extends UnitTestCase { |
|
19 | + public function assertInvalidXml($xml) { |
|
22 | 20 | $result = Helper::getXmlFileAsString($xml); |
23 | 21 | self::assertEquals(false, $result); |
24 | 22 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | public function assertInvalidXml($xml) |
21 | 21 | { |
22 | 22 | $result = Helper::getXmlFileAsString($xml); |
23 | - self::assertEquals(false, $result); |
|
23 | + self::assertEquals(FALSE, $result); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function invalidXmlYieldsFalse(): void |
31 | 31 | { |
32 | - self::assertInvalidXml(false); |
|
33 | - self::assertInvalidXml(null); |
|
32 | + self::assertInvalidXml(FALSE); |
|
33 | + self::assertInvalidXml(NULL); |
|
34 | 34 | self::assertInvalidXml(1); |
35 | 35 | self::assertInvalidXml([]); |
36 | 36 | self::assertInvalidXml(new \stdClass()); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | <root> |
51 | 51 | <single /> |
52 | 52 | </root> |
53 | -XML; |
|
53 | +xml; |
|
54 | 54 | $node = Helper::getXmlFileAsString($xml); |
55 | 55 | self::assertIsObject($node); |
56 | 56 | self::assertEquals('root', $node->getName()); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | { |
37 | 37 | parent::tearDown(); |
38 | 38 | |
39 | - unlink(__DIR__ . '/../../Fixtures/Repository/tokenTemp.csv'); |
|
39 | + unlink(__DIR__.'/../../Fixtures/Repository/tokenTemp.csv'); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function deleteExpiredTokens(): void |
47 | 47 | { |
48 | - $inputCsvFile = __DIR__ . '/../../Fixtures/Repository/token.csv'; |
|
49 | - $outputCsvFile = __DIR__ . '/../../Fixtures/Repository/tokenTemp.csv'; |
|
48 | + $inputCsvFile = __DIR__.'/../../Fixtures/Repository/token.csv'; |
|
49 | + $outputCsvFile = __DIR__.'/../../Fixtures/Repository/tokenTemp.csv'; |
|
50 | 50 | |
51 | 51 | $inputCsvData = file_get_contents($inputCsvFile); |
52 | 52 | $csvData = str_getcsv($inputCsvData, "\n"); |
@@ -15,8 +15,7 @@ |
||
15 | 15 | use Kitodo\Dlf\Domain\Repository\TokenRepository; |
16 | 16 | use Kitodo\Dlf\Tests\Functional\FunctionalTestCase; |
17 | 17 | |
18 | -class TokenRepositoryTest extends FunctionalTestCase |
|
19 | -{ |
|
18 | +class TokenRepositoryTest extends FunctionalTestCase { |
|
20 | 19 | /** |
21 | 20 | * @var TokenRepository |
22 | 21 | */ |
@@ -32,7 +32,7 @@ |
||
32 | 32 | 20000 |
33 | 33 | ); |
34 | 34 | |
35 | - $this->importCSVDataSet(__DIR__ . '/../../Fixtures/Repository/collections.csv'); |
|
35 | + $this->importCSVDataSet(__DIR__.'/../../Fixtures/Repository/collections.csv'); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -16,8 +16,7 @@ |
||
16 | 16 | use Kitodo\Dlf\Domain\Repository\CollectionRepository; |
17 | 17 | use Kitodo\Dlf\Tests\Functional\FunctionalTestCase; |
18 | 18 | |
19 | -class CollectionRepositoryTest extends FunctionalTestCase |
|
20 | -{ |
|
19 | +class CollectionRepositoryTest extends FunctionalTestCase { |
|
21 | 20 | /** |
22 | 21 | * @var CollectionRepository |
23 | 22 | */ |
@@ -107,14 +107,14 @@ discard block |
||
107 | 107 | $collectionsByLabel = $this->findCollectionsBySettings( |
108 | 108 | [ |
109 | 109 | 'index_name' => ['Geschichte', 'collection-with-single-document'], |
110 | - 'show_userdefined' => true |
|
110 | + 'show_userdefined' => TRUE |
|
111 | 111 | ] |
112 | 112 | ); |
113 | 113 | self::assertCount(2, $collectionsByLabel); |
114 | 114 | self::assertArrayHasKey('Geschichte', $collectionsByLabel); |
115 | 115 | self::assertArrayHasKey('Collection with single document', $collectionsByLabel); |
116 | 116 | |
117 | - $collectionsByLabel = $this->findCollectionsBySettings(['show_userdefined' => true]); |
|
117 | + $collectionsByLabel = $this->findCollectionsBySettings(['show_userdefined' => TRUE]); |
|
118 | 118 | self::assertCount(4, $collectionsByLabel); |
119 | 119 | self::assertArrayHasKey('Musik', $collectionsByLabel); |
120 | 120 | self::assertArrayHasKey('Collection with single document', $collectionsByLabel); |
@@ -125,20 +125,20 @@ discard block |
||
125 | 125 | implode(', ', array_keys($collectionsByLabel)) |
126 | 126 | ); |
127 | 127 | |
128 | - $collectionsByLabel = $this->findCollectionsBySettings(['show_userdefined' => false]); |
|
128 | + $collectionsByLabel = $this->findCollectionsBySettings(['show_userdefined' => FALSE]); |
|
129 | 129 | self::assertCount(2, $collectionsByLabel); |
130 | 130 | self::assertArrayHasKey('Musik', $collectionsByLabel); |
131 | 131 | self::assertArrayHasKey('Collection with single document', $collectionsByLabel); |
132 | 132 | |
133 | - $collectionsByLabel = $this->findCollectionsBySettings(['hideEmptyOaiNames' => true]); |
|
133 | + $collectionsByLabel = $this->findCollectionsBySettings(['hideEmptyOaiNames' => TRUE]); |
|
134 | 134 | self::assertCount(2, $collectionsByLabel); |
135 | 135 | self::assertArrayHasKey('Musik', $collectionsByLabel); |
136 | 136 | self::assertArrayHasKey('Collection with single document', $collectionsByLabel); |
137 | 137 | |
138 | 138 | $collectionsByLabel = $this->findCollectionsBySettings( |
139 | 139 | [ |
140 | - 'hideEmptyOaiNames' => true, |
|
141 | - 'show_userdefined' => true |
|
140 | + 'hideEmptyOaiNames' => TRUE, |
|
141 | + 'show_userdefined' => TRUE |
|
142 | 142 | ] |
143 | 143 | ); |
144 | 144 | self::assertCount(3, $collectionsByLabel); |
@@ -148,8 +148,8 @@ discard block |
||
148 | 148 | |
149 | 149 | $collectionsByLabel = $this->findCollectionsBySettings( |
150 | 150 | [ |
151 | - 'hideEmptyOaiNames' => false, |
|
152 | - 'show_userdefined' => true |
|
151 | + 'hideEmptyOaiNames' => FALSE, |
|
152 | + 'show_userdefined' => TRUE |
|
153 | 153 | ] |
154 | 154 | ); |
155 | 155 | self::assertCount(4, $collectionsByLabel); |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | $collectionsByLabel = $this->findCollectionsBySettings( |
162 | 162 | [ |
163 | 163 | 'collections' => '1101, 1102, 1103, 1104', |
164 | - 'show_userdefined' => true, |
|
165 | - 'hideEmptyOaiNames' => false, |
|
164 | + 'show_userdefined' => TRUE, |
|
165 | + 'hideEmptyOaiNames' => FALSE, |
|
166 | 166 | 'index_name' => ['Geschichte', 'collection-with-single-document'] |
167 | 167 | ] |
168 | 168 | ); |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | public function canGetIndexNameForSolr(): void |
180 | 180 | { |
181 | 181 | $indexName = $this->collectionRepository->getIndexNameForSolr( |
182 | - ['show_userdefined' => true, 'storagePid' => '20000'], 'history' |
|
182 | + ['show_userdefined' => TRUE, 'storagePid' => '20000'], 'history' |
|
183 | 183 | ); |
184 | 184 | $result = $indexName->fetchAllAssociative(); |
185 | 185 | self::assertEquals(1, $indexName->rowCount()); |
@@ -188,12 +188,12 @@ discard block |
||
188 | 188 | self::assertEquals('1103', $result[0]['uid']); |
189 | 189 | |
190 | 190 | $indexName = $this->collectionRepository->getIndexNameForSolr( |
191 | - ['show_userdefined' => false, 'storagePid' => '20000'], 'history' |
|
191 | + ['show_userdefined' => FALSE, 'storagePid' => '20000'], 'history' |
|
192 | 192 | ); |
193 | 193 | self::assertEquals(0, $indexName->rowCount()); |
194 | 194 | |
195 | 195 | $indexName = $this->collectionRepository->getIndexNameForSolr( |
196 | - ['show_userdefined' => false, 'storagePid' => '20000'], 'collection-with-single-document' |
|
196 | + ['show_userdefined' => FALSE, 'storagePid' => '20000'], 'collection-with-single-document' |
|
197 | 197 | ); |
198 | 198 | self::assertEquals(1, $indexName->rowCount()); |
199 | 199 | self::assertEquals('collection-with-single-document', $indexName->fetchOne()); |
@@ -31,9 +31,9 @@ |
||
31 | 31 | |
32 | 32 | $this->documentRepository = $this->initializeRepository(DocumentRepository::class, 20000); |
33 | 33 | |
34 | - $this->importCSVDataSet(__DIR__ . '/../../Fixtures/Common/documents_1.csv'); |
|
35 | - $this->importDataSet(__DIR__ . '/../../Fixtures/Common/pages.xml'); |
|
36 | - $this->importCSVDataSet(__DIR__ . '/../../Fixtures/Common/libraries.csv'); |
|
34 | + $this->importCSVDataSet(__DIR__.'/../../Fixtures/Common/documents_1.csv'); |
|
35 | + $this->importDataSet(__DIR__.'/../../Fixtures/Common/pages.xml'); |
|
36 | + $this->importCSVDataSet(__DIR__.'/../../Fixtures/Common/libraries.csv'); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
@@ -32,7 +32,7 @@ |
||
32 | 32 | 20000 |
33 | 33 | ); |
34 | 34 | |
35 | - $this->importCSVDataSet(__DIR__ . '/../../Fixtures/Repository/mail.csv'); |
|
35 | + $this->importCSVDataSet(__DIR__.'/../../Fixtures/Repository/mail.csv'); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -16,8 +16,7 @@ |
||
16 | 16 | use Kitodo\Dlf\Domain\Repository\MailRepository; |
17 | 17 | use Kitodo\Dlf\Tests\Functional\FunctionalTestCase; |
18 | 18 | |
19 | -class MailRepositoryTest extends FunctionalTestCase |
|
20 | -{ |
|
19 | +class MailRepositoryTest extends FunctionalTestCase { |
|
21 | 20 | /** |
22 | 21 | * @var MailRepository |
23 | 22 | */ |
@@ -32,7 +32,7 @@ |
||
32 | 32 | 20000 |
33 | 33 | ); |
34 | 34 | |
35 | - $this->importCSVDataSet(__DIR__ . '/../../Fixtures/Repository/metadata.csv'); |
|
35 | + $this->importCSVDataSet(__DIR__.'/../../Fixtures/Repository/metadata.csv'); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 |
@@ -16,8 +16,7 @@ discard block |
||
16 | 16 | use Kitodo\Dlf\Domain\Repository\MetadataRepository; |
17 | 17 | use Kitodo\Dlf\Tests\Functional\FunctionalTestCase; |
18 | 18 | |
19 | -class MetadataRepositoryTest extends FunctionalTestCase |
|
20 | -{ |
|
19 | +class MetadataRepositoryTest extends FunctionalTestCase { |
|
21 | 20 | /** |
22 | 21 | * @var MetadataRepository |
23 | 22 | */ |
@@ -40,8 +39,7 @@ discard block |
||
40 | 39 | * @param $settings |
41 | 40 | * @return array |
42 | 41 | */ |
43 | - protected function findBySettings($settings) |
|
44 | - { |
|
42 | + protected function findBySettings($settings) { |
|
45 | 43 | $metadata = $this->metadataRepository->findBySettings($settings); |
46 | 44 | self::assertNotNull($metadata); |
47 | 45 | self::assertInstanceOf(QueryResult::class, $metadata); |
@@ -67,14 +67,14 @@ discard block |
||
67 | 67 | implode(', ', array_keys($metadataByLabel)) |
68 | 68 | ); |
69 | 69 | |
70 | - $metadataByLabel = $this->findBySettings(['is_listed' => true]); |
|
70 | + $metadataByLabel = $this->findBySettings(['is_listed' => TRUE]); |
|
71 | 71 | self::assertCount(3, $metadataByLabel); |
72 | 72 | self::assertEquals( |
73 | 73 | 'Autor, Institution, Titel', |
74 | 74 | implode(', ', array_keys($metadataByLabel)) |
75 | 75 | ); |
76 | 76 | |
77 | - $metadataByLabel = $this->findBySettings(['is_sortable' => true]); |
|
77 | + $metadataByLabel = $this->findBySettings(['is_sortable' => TRUE]); |
|
78 | 78 | self::assertCount(4, $metadataByLabel); |
79 | 79 | self::assertEquals( |
80 | 80 | 'Ort, Untertitel, Autor, Titel', |
@@ -83,8 +83,8 @@ discard block |
||
83 | 83 | |
84 | 84 | $metadataByLabel = $this->findBySettings( |
85 | 85 | [ |
86 | - 'is_sortable' => true, |
|
87 | - 'is_listed' => true |
|
86 | + 'is_sortable' => TRUE, |
|
87 | + 'is_listed' => TRUE |
|
88 | 88 | ] |
89 | 89 | ); |
90 | 90 | self::assertCount(2, $metadataByLabel); |