@@ -19,13 +19,11 @@ |
||
19 | 19 | /** |
20 | 20 | * Add inline JavaScript code to footer * |
21 | 21 | */ |
22 | -class JsFooterViewHelper extends AbstractViewHelper |
|
23 | -{ |
|
22 | +class JsFooterViewHelper extends AbstractViewHelper { |
|
24 | 23 | /** |
25 | 24 | * Initialize arguments. |
26 | 25 | */ |
27 | - public function initializeArguments() |
|
28 | - { |
|
26 | + public function initializeArguments() { |
|
29 | 27 | parent::initializeArguments(); |
30 | 28 | $this->registerArgument('inlineCode', 'string', 'Inline JavaScript', true); |
31 | 29 | } |
@@ -26,8 +26,7 @@ discard block |
||
26 | 26 | * @subpackage dlf |
27 | 27 | * @access public |
28 | 28 | */ |
29 | -class PageViewController extends AbstractController |
|
30 | -{ |
|
29 | +class PageViewController extends AbstractController { |
|
31 | 30 | /** |
32 | 31 | * Holds the controls to add to the map |
33 | 32 | * |
@@ -65,8 +64,7 @@ discard block |
||
65 | 64 | * |
66 | 65 | * @return void |
67 | 66 | */ |
68 | - public function mainAction() |
|
69 | - { |
|
67 | + public function mainAction() { |
|
70 | 68 | // Load current document. |
71 | 69 | $this->loadDocument($this->requestData); |
72 | 70 | if ( |
@@ -121,8 +119,7 @@ discard block |
||
121 | 119 | * |
122 | 120 | * @return array URL and MIME type of fulltext file |
123 | 121 | */ |
124 | - protected function getFulltext($page) |
|
125 | - { |
|
122 | + protected function getFulltext($page) { |
|
126 | 123 | $fulltext = []; |
127 | 124 | // Get fulltext link. |
128 | 125 | $fileGrpsFulltext = GeneralUtility::trimExplode(',', $this->extConf['fileGrpFulltext']); |
@@ -162,8 +159,7 @@ discard block |
||
162 | 159 | * |
163 | 160 | * @return void |
164 | 161 | */ |
165 | - protected function addViewerJS() |
|
166 | - { |
|
162 | + protected function addViewerJS() { |
|
167 | 163 | // Viewer configuration. |
168 | 164 | $viewerConfiguration = '$(document).ready(function() { |
169 | 165 | if (dlfUtils.exists(dlfViewer)) { |
@@ -189,8 +185,7 @@ discard block |
||
189 | 185 | * @return array An array containing the IRIs of the AnnotationLists / AnnotationPages as well as |
190 | 186 | * some information about the canvas. |
191 | 187 | */ |
192 | - protected function getAnnotationContainers($page) |
|
193 | - { |
|
188 | + protected function getAnnotationContainers($page) { |
|
194 | 189 | if ($this->document->getDoc() instanceof IiifManifest) { |
195 | 190 | $canvasId = $this->document->getDoc()->physicalStructure[$page]; |
196 | 191 | $iiif = $this->document->getDoc()->getIiif(); |
@@ -246,8 +241,7 @@ discard block |
||
246 | 241 | * |
247 | 242 | * @return array URL and MIME type of image file |
248 | 243 | */ |
249 | - protected function getImage($page) |
|
250 | - { |
|
244 | + protected function getImage($page) { |
|
251 | 245 | $image = []; |
252 | 246 | // Get @USE value of METS fileGrp. |
253 | 247 | $fileGrpsImages = GeneralUtility::trimExplode(',', $this->extConf['fileGrpImages']); |
@@ -31,8 +31,7 @@ discard block |
||
31 | 31 | * @subpackage dlf |
32 | 32 | * @access public |
33 | 33 | */ |
34 | -class Helper |
|
35 | -{ |
|
34 | +class Helper { |
|
36 | 35 | /** |
37 | 36 | * The extension key |
38 | 37 | * |
@@ -80,8 +79,7 @@ discard block |
||
80 | 79 | * |
81 | 80 | * @return \TYPO3\CMS\Core\Messaging\FlashMessageQueue The queue the message was added to |
82 | 81 | */ |
83 | - public static function addMessage($message, $title, $severity, $session = false, $queue = 'kitodo.default.flashMessages') |
|
84 | - { |
|
82 | + public static function addMessage($message, $title, $severity, $session = false, $queue = 'kitodo.default.flashMessages') { |
|
85 | 83 | $flashMessageService = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessageService::class); |
86 | 84 | $flashMessageQueue = $flashMessageService->getMessageQueueByIdentifier($queue); |
87 | 85 | $flashMessage = GeneralUtility::makeInstance( |
@@ -106,8 +104,7 @@ discard block |
||
106 | 104 | * |
107 | 105 | * @return bool Is $id a valid GNL identifier of the given $type? |
108 | 106 | */ |
109 | - public static function checkIdentifier($id, $type) |
|
110 | - { |
|
107 | + public static function checkIdentifier($id, $type) { |
|
111 | 108 | $digits = substr($id, 0, 8); |
112 | 109 | $checksum = 0; |
113 | 110 | for ($i = 0, $j = strlen($digits); $i < $j; $i++) { |
@@ -171,8 +168,7 @@ discard block |
||
171 | 168 | * |
172 | 169 | * @return mixed The decrypted value or false on error |
173 | 170 | */ |
174 | - public static function decrypt($encrypted) |
|
175 | - { |
|
171 | + public static function decrypt($encrypted) { |
|
176 | 172 | if ( |
177 | 173 | !in_array(self::$cipherAlgorithm, openssl_get_cipher_methods(true)) |
178 | 174 | || !in_array(self::$hashAlgorithm, openssl_get_md_methods(true)) |
@@ -211,8 +207,7 @@ discard block |
||
211 | 207 | * |
212 | 208 | * @return \SimpleXMLElement|false |
213 | 209 | */ |
214 | - public static function getXmlFileAsString($content) |
|
215 | - { |
|
210 | + public static function getXmlFileAsString($content) { |
|
216 | 211 | // Don't make simplexml_load_string throw (when $content is an array |
217 | 212 | // or object) |
218 | 213 | if (!is_string($content)) { |
@@ -243,8 +238,7 @@ discard block |
||
243 | 238 | * |
244 | 239 | * @return void |
245 | 240 | */ |
246 | - public static function log($message, $severity = 0) |
|
247 | - { |
|
241 | + public static function log($message, $severity = 0) { |
|
248 | 242 | $logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(get_called_class()); |
249 | 243 | |
250 | 244 | switch ($severity) { |
@@ -274,8 +268,7 @@ discard block |
||
274 | 268 | * |
275 | 269 | * @return mixed Hashed string or false on error |
276 | 270 | */ |
277 | - public static function digest($string) |
|
278 | - { |
|
271 | + public static function digest($string) { |
|
279 | 272 | if (!in_array(self::$hashAlgorithm, openssl_get_md_methods(true))) { |
280 | 273 | self::log('OpenSSL library doesn\'t support hash algorithm', LOG_SEVERITY_ERROR); |
281 | 274 | return false; |
@@ -294,8 +287,7 @@ discard block |
||
294 | 287 | * |
295 | 288 | * @return mixed Encrypted string or false on error |
296 | 289 | */ |
297 | - public static function encrypt($string) |
|
298 | - { |
|
290 | + public static function encrypt($string) { |
|
299 | 291 | if ( |
300 | 292 | !in_array(self::$cipherAlgorithm, openssl_get_cipher_methods(true)) |
301 | 293 | || !in_array(self::$hashAlgorithm, openssl_get_md_methods(true)) |
@@ -328,8 +320,7 @@ discard block |
||
328 | 320 | * |
329 | 321 | * @return string The unqualified class name |
330 | 322 | */ |
331 | - public static function getUnqualifiedClassName($qualifiedClassname) |
|
332 | - { |
|
323 | + public static function getUnqualifiedClassName($qualifiedClassname) { |
|
333 | 324 | $nameParts = explode('\\', $qualifiedClassname); |
334 | 325 | return end($nameParts); |
335 | 326 | } |
@@ -343,8 +334,7 @@ discard block |
||
343 | 334 | * |
344 | 335 | * @return string The cleaned up string |
345 | 336 | */ |
346 | - public static function getCleanString($string) |
|
347 | - { |
|
337 | + public static function getCleanString($string) { |
|
348 | 338 | // Convert to lowercase. |
349 | 339 | $string = strtolower($string); |
350 | 340 | // Remove non-alphanumeric characters. |
@@ -365,8 +355,7 @@ discard block |
||
365 | 355 | * |
366 | 356 | * @return array Array of hook objects for the class |
367 | 357 | */ |
368 | - public static function getHookObjects($scriptRelPath) |
|
369 | - { |
|
358 | + public static function getHookObjects($scriptRelPath) { |
|
370 | 359 | $hookObjects = []; |
371 | 360 | if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::$extKey . '/' . $scriptRelPath]['hookClass'])) { |
372 | 361 | foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::$extKey . '/' . $scriptRelPath]['hookClass'] as $classRef) { |
@@ -387,8 +376,7 @@ discard block |
||
387 | 376 | * |
388 | 377 | * @return string "index_name" for the given UID |
389 | 378 | */ |
390 | - public static function getIndexNameFromUid($uid, $table, $pid = -1) |
|
391 | - { |
|
379 | + public static function getIndexNameFromUid($uid, $table, $pid = -1) { |
|
392 | 380 | // Sanitize input. |
393 | 381 | $uid = max(intval($uid), 0); |
394 | 382 | if ( |
@@ -438,8 +426,7 @@ discard block |
||
438 | 426 | * |
439 | 427 | * @return string Localized full name of language or unchanged input |
440 | 428 | */ |
441 | - public static function getLanguageName($code) |
|
442 | - { |
|
429 | + public static function getLanguageName($code) { |
|
443 | 430 | // Analyze code and set appropriate ISO table. |
444 | 431 | $isoCode = strtolower(trim($code)); |
445 | 432 | if (preg_match('/^[a-z]{3}$/', $isoCode)) { |
@@ -481,8 +468,7 @@ discard block |
||
481 | 468 | * |
482 | 469 | * @return array |
483 | 470 | */ |
484 | - public static function getDocumentStructures($pid = -1) |
|
485 | - { |
|
471 | + public static function getDocumentStructures($pid = -1) { |
|
486 | 472 | $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class); |
487 | 473 | $queryBuilder = $connectionPool->getQueryBuilderForTable('tx_dlf_structures'); |
488 | 474 | |
@@ -522,8 +508,7 @@ discard block |
||
522 | 508 | * |
523 | 509 | * @return string Uniform Resource Name as string |
524 | 510 | */ |
525 | - public static function getURN($base, $id) |
|
526 | - { |
|
511 | + public static function getURN($base, $id) { |
|
527 | 512 | $concordance = [ |
528 | 513 | '0' => 1, |
529 | 514 | '1' => 2, |
@@ -590,8 +575,7 @@ discard block |
||
590 | 575 | * |
591 | 576 | * @return bool Is $id a valid PPN? |
592 | 577 | */ |
593 | - public static function isPPN($id) |
|
594 | - { |
|
578 | + public static function isPPN($id) { |
|
595 | 579 | return self::checkIdentifier($id, 'PPN'); |
596 | 580 | } |
597 | 581 | |
@@ -602,8 +586,7 @@ discard block |
||
602 | 586 | * |
603 | 587 | * @return bool |
604 | 588 | */ |
605 | - public static function isValidHttpUrl($url) |
|
606 | - { |
|
589 | + public static function isValidHttpUrl($url) { |
|
607 | 590 | if (!GeneralUtility::isValidUrl($url)) { |
608 | 591 | return false; |
609 | 592 | } |
@@ -629,8 +612,7 @@ discard block |
||
629 | 612 | * |
630 | 613 | * @return array Merged array |
631 | 614 | */ |
632 | - public static function mergeRecursiveWithOverrule(array $original, array $overrule, $addKeys = true, $includeEmptyValues = true, $enableUnsetFeature = true) |
|
633 | - { |
|
615 | + public static function mergeRecursiveWithOverrule(array $original, array $overrule, $addKeys = true, $includeEmptyValues = true, $enableUnsetFeature = true) { |
|
634 | 616 | \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($original, $overrule, $addKeys, $includeEmptyValues, $enableUnsetFeature); |
635 | 617 | return $original; |
636 | 618 | } |
@@ -644,8 +626,7 @@ discard block |
||
644 | 626 | * |
645 | 627 | * @return string All flash messages in the queue rendered as HTML. |
646 | 628 | */ |
647 | - public static function renderFlashMessages($queue = 'kitodo.default.flashMessages') |
|
648 | - { |
|
629 | + public static function renderFlashMessages($queue = 'kitodo.default.flashMessages') { |
|
649 | 630 | $flashMessageService = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessageService::class); |
650 | 631 | $flashMessageQueue = $flashMessageService->getMessageQueueByIdentifier($queue); |
651 | 632 | $flashMessages = $flashMessageQueue->getAllMessagesAndFlush(); |
@@ -665,8 +646,7 @@ discard block |
||
665 | 646 | * |
666 | 647 | * @return string Localized label for $index_name |
667 | 648 | */ |
668 | - public static function translate($index_name, $table, $pid) |
|
669 | - { |
|
649 | + public static function translate($index_name, $table, $pid) { |
|
670 | 650 | // Load labels into static variable for future use. |
671 | 651 | static $labels = []; |
672 | 652 | // Sanitize input. |
@@ -794,8 +774,7 @@ discard block |
||
794 | 774 | * |
795 | 775 | * @return string Additional WHERE expression |
796 | 776 | */ |
797 | - public static function whereExpression($table, $showHidden = false) |
|
798 | - { |
|
777 | + public static function whereExpression($table, $showHidden = false) { |
|
799 | 778 | if (\TYPO3_MODE === 'FE') { |
800 | 779 | // Should we ignore the record's hidden flag? |
801 | 780 | $ignoreHide = 0; |
@@ -827,8 +806,7 @@ discard block |
||
827 | 806 | * |
828 | 807 | * @access private |
829 | 808 | */ |
830 | - private function __construct() |
|
831 | - { |
|
809 | + private function __construct() { |
|
832 | 810 | // This is a static class, thus no instances should be created. |
833 | 811 | } |
834 | 812 | |
@@ -854,8 +832,7 @@ discard block |
||
854 | 832 | * |
855 | 833 | * @access public |
856 | 834 | */ |
857 | - public static function polyfillExtbaseClassesForTYPO3v9() |
|
858 | - { |
|
835 | + public static function polyfillExtbaseClassesForTYPO3v9() { |
|
859 | 836 | $classes = require __DIR__ . '/../../Configuration/Extbase/Persistence/Classes.php'; |
860 | 837 | |
861 | 838 | $objectManager = GeneralUtility::makeInstance(ObjectManager::class); |
@@ -892,8 +869,7 @@ discard block |
||
892 | 869 | * |
893 | 870 | * @return string|bool |
894 | 871 | */ |
895 | - public static function getUrl(string $url) |
|
896 | - { |
|
872 | + public static function getUrl(string $url) { |
|
897 | 873 | if (!Helper::isValidHttpUrl($url)) { |
898 | 874 | return false; |
899 | 875 | } |
@@ -32,8 +32,7 @@ discard block |
||
32 | 32 | * @subpackage dlf |
33 | 33 | * @access public |
34 | 34 | */ |
35 | -class SearchController extends AbstractController |
|
36 | -{ |
|
35 | +class SearchController extends AbstractController { |
|
37 | 36 | /** |
38 | 37 | * @var CollectionRepository |
39 | 38 | */ |
@@ -42,8 +41,7 @@ discard block |
||
42 | 41 | /** |
43 | 42 | * @param CollectionRepository $collectionRepository |
44 | 43 | */ |
45 | - public function injectCollectionRepository(CollectionRepository $collectionRepository) |
|
46 | - { |
|
44 | + public function injectCollectionRepository(CollectionRepository $collectionRepository) { |
|
47 | 45 | $this->collectionRepository = $collectionRepository; |
48 | 46 | } |
49 | 47 | |
@@ -55,8 +53,7 @@ discard block |
||
55 | 53 | /** |
56 | 54 | * @param MetadataRepository $metadataRepository |
57 | 55 | */ |
58 | - public function injectMetadataRepository(MetadataRepository $metadataRepository) |
|
59 | - { |
|
56 | + public function injectMetadataRepository(MetadataRepository $metadataRepository) { |
|
60 | 57 | $this->metadataRepository = $metadataRepository; |
61 | 58 | } |
62 | 59 | |
@@ -71,8 +68,7 @@ discard block |
||
71 | 68 | * |
72 | 69 | * @return void |
73 | 70 | */ |
74 | - public function searchAction() |
|
75 | - { |
|
71 | + public function searchAction() { |
|
76 | 72 | // if search was triggered, get search parameters from POST variables |
77 | 73 | $this->searchParams = $this->getParametersSafely('searchParameter'); |
78 | 74 | |
@@ -87,8 +83,7 @@ discard block |
||
87 | 83 | * |
88 | 84 | * @return void |
89 | 85 | */ |
90 | - public function mainAction() |
|
91 | - { |
|
86 | + public function mainAction() { |
|
92 | 87 | $listViewSearch = false; |
93 | 88 | // Quit without doing anything if required variables are not set. |
94 | 89 | if (empty($this->settings['solrcore'])) { |
@@ -174,8 +169,7 @@ discard block |
||
174 | 169 | * |
175 | 170 | * @return string HTML output of facets menu |
176 | 171 | */ |
177 | - protected function addFacetsMenu() |
|
178 | - { |
|
172 | + protected function addFacetsMenu() { |
|
179 | 173 | // Quit without doing anything if no facets are configured. |
180 | 174 | if (empty($this->settings['facets']) && empty($this->settings['facetCollections'])) { |
181 | 175 | return ''; |
@@ -200,8 +194,7 @@ discard block |
||
200 | 194 | * |
201 | 195 | * @return array HMENU array |
202 | 196 | */ |
203 | - public function makeFacetsMenuArray($facets) |
|
204 | - { |
|
197 | + public function makeFacetsMenuArray($facets) { |
|
205 | 198 | $menuArray = []; |
206 | 199 | // Set default value for facet search. |
207 | 200 | $search = [ |
@@ -360,8 +353,7 @@ discard block |
||
360 | 353 | * |
361 | 354 | * @return array The array for the facet's menu entry |
362 | 355 | */ |
363 | - protected function getFacetsMenuEntry($field, $value, $count, $search, &$state) |
|
364 | - { |
|
356 | + protected function getFacetsMenuEntry($field, $value, $count, $search, &$state) { |
|
365 | 357 | $entryArray = []; |
366 | 358 | // Translate value. |
367 | 359 | if ($field == 'owner_faceting') { |
@@ -412,8 +404,7 @@ discard block |
||
412 | 404 | * |
413 | 405 | * @return string The extended search form or an empty string |
414 | 406 | */ |
415 | - protected function addExtendedSearch() |
|
416 | - { |
|
407 | + protected function addExtendedSearch() { |
|
417 | 408 | // Quit without doing anything if no fields for extended search are selected. |
418 | 409 | if ( |
419 | 410 | empty($this->settings['extendedSlotCount']) |
@@ -5,10 +5,8 @@ |
||
5 | 5 | use Kitodo\Dlf\Common\Helper; |
6 | 6 | use TYPO3\TestingFramework\Core\Unit\UnitTestCase; |
7 | 7 | |
8 | -class HelperTest extends UnitTestCase |
|
9 | -{ |
|
10 | - public function assertInvalidXml($xml) |
|
11 | - { |
|
8 | +class HelperTest extends UnitTestCase { |
|
9 | + public function assertInvalidXml($xml) { |
|
12 | 10 | $result = Helper::getXmlFileAsString($xml); |
13 | 11 | $this->assertEquals(false, $result); |
14 | 12 | } |
@@ -12,8 +12,7 @@ discard block |
||
12 | 12 | * Base class for functional test cases. This provides some common configuration |
13 | 13 | * and collects utility methods for functional tests. |
14 | 14 | */ |
15 | -class FunctionalTestCase extends \TYPO3\TestingFramework\Core\Functional\FunctionalTestCase |
|
16 | -{ |
|
15 | +class FunctionalTestCase extends \TYPO3\TestingFramework\Core\Functional\FunctionalTestCase { |
|
17 | 16 | protected $testExtensionsToLoad = [ |
18 | 17 | 'typo3conf/ext/dlf', |
19 | 18 | ]; |
@@ -63,8 +62,7 @@ discard block |
||
63 | 62 | */ |
64 | 63 | protected $httpClient; |
65 | 64 | |
66 | - public function __construct() |
|
67 | - { |
|
65 | + public function __construct() { |
|
68 | 66 | parent::__construct(); |
69 | 67 | |
70 | 68 | $this->configurationToUseInTestInstance['EXTENSIONS']['dlf'] = $this->getDlfConfiguration(); |
@@ -91,8 +89,7 @@ discard block |
||
91 | 89 | $this->addSiteConfig('dlf-testing', $this->baseUrl); |
92 | 90 | } |
93 | 91 | |
94 | - protected function getDlfConfiguration() |
|
95 | - { |
|
92 | + protected function getDlfConfiguration() { |
|
96 | 93 | return [ |
97 | 94 | 'solrFieldAutocomplete' => 'autocomplete', |
98 | 95 | 'solrFieldCollection' => 'collection', |
@@ -124,8 +121,7 @@ discard block |
||
124 | 121 | ]; |
125 | 122 | } |
126 | 123 | |
127 | - protected function addSiteConfig($identifier, $baseUrl) |
|
128 | - { |
|
124 | + protected function addSiteConfig($identifier, $baseUrl) { |
|
129 | 125 | $siteConfig = Yaml::parseFile(__DIR__ . '/../Fixtures/siteconfig.yaml'); |
130 | 126 | $siteConfig['base'] = $baseUrl; |
131 | 127 | $siteConfig['languages'][0]['base'] = $baseUrl; |
@@ -135,8 +131,7 @@ discard block |
||
135 | 131 | file_put_contents($siteConfigPath . '/config.yaml', Yaml::dump($siteConfig)); |
136 | 132 | } |
137 | 133 | |
138 | - protected function initializeRepository(string $className, int $storagePid) |
|
139 | - { |
|
134 | + protected function initializeRepository(string $className, int $storagePid) { |
|
140 | 135 | $repository = $this->objectManager->get($className); |
141 | 136 | |
142 | 137 | $querySettings = $this->objectManager->get(Typo3QuerySettings::class); |
@@ -6,19 +6,16 @@ |
||
6 | 6 | use Kitodo\Dlf\Tests\Functional\FunctionalTestCase; |
7 | 7 | use TYPO3\CMS\Core\Utility\GeneralUtility; |
8 | 8 | |
9 | -class PageViewProxyTest extends FunctionalTestCase |
|
10 | -{ |
|
9 | +class PageViewProxyTest extends FunctionalTestCase { |
|
11 | 10 | protected $disableJsonWrappedResponse = true; |
12 | 11 | |
13 | - protected function getDlfConfiguration() |
|
14 | - { |
|
12 | + protected function getDlfConfiguration() { |
|
15 | 13 | return array_merge(parent::getDlfConfiguration(), [ |
16 | 14 | 'enableInternalProxy' => true, |
17 | 15 | ]); |
18 | 16 | } |
19 | 17 | |
20 | - protected function queryProxy(array $query, string $method = 'GET') |
|
21 | - { |
|
18 | + protected function queryProxy(array $query, string $method = 'GET') { |
|
22 | 19 | $query['eID'] = 'tx_dlf_pageview_proxy'; |
23 | 20 | |
24 | 21 | return $this->httpClient->request($method, '', [ |
@@ -5,12 +5,10 @@ |
||
5 | 5 | use Kitodo\Dlf\Tests\Functional\FunctionalTestCase; |
6 | 6 | use TYPO3\CMS\Core\Utility\GeneralUtility; |
7 | 7 | |
8 | -class PageViewProxyDisabledTest extends FunctionalTestCase |
|
9 | -{ |
|
8 | +class PageViewProxyDisabledTest extends FunctionalTestCase { |
|
10 | 9 | protected $disableJsonWrappedResponse = true; |
11 | 10 | |
12 | - protected function queryProxy(array $query, string $method = 'GET') |
|
13 | - { |
|
11 | + protected function queryProxy(array $query, string $method = 'GET') { |
|
14 | 12 | $query['eID'] = 'tx_dlf_pageview_proxy'; |
15 | 13 | |
16 | 14 | return $this->httpClient->request($method, '', [ |
@@ -12,8 +12,7 @@ discard block |
||
12 | 12 | use SimpleXMLElement; |
13 | 13 | use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager; |
14 | 14 | |
15 | -class OaiPmhTest extends FunctionalTestCase |
|
16 | -{ |
|
15 | +class OaiPmhTest extends FunctionalTestCase { |
|
17 | 16 | protected $disableJsonWrappedResponse = true; |
18 | 17 | |
19 | 18 | protected $coreExtensionsToLoad = [ |
@@ -53,8 +52,7 @@ discard block |
||
53 | 52 | $this->setUpOaiSolr(); |
54 | 53 | } |
55 | 54 | |
56 | - protected function setUpOaiSolr() |
|
57 | - { |
|
55 | + protected function setUpOaiSolr() { |
|
58 | 56 | // Setup Solr only once for all tests in this suite |
59 | 57 | static $solr = null; |
60 | 58 | |
@@ -71,8 +69,7 @@ discard block |
||
71 | 69 | $this->persistenceManager->persistAll(); |
72 | 70 | } |
73 | 71 | |
74 | - protected function importSolrDocuments(Solr $solr, string $path) |
|
75 | - { |
|
72 | + protected function importSolrDocuments(Solr $solr, string $path) { |
|
76 | 73 | $jsonDocuments = json_decode(file_get_contents($path), true); |
77 | 74 | |
78 | 75 | $updateQuery = $solr->service->createUpdate(); |
@@ -91,8 +88,7 @@ discard block |
||
91 | 88 | /** |
92 | 89 | * @test |
93 | 90 | */ |
94 | - public function correctlyRespondsOnBadVerb() |
|
95 | - { |
|
91 | + public function correctlyRespondsOnBadVerb() { |
|
96 | 92 | $client = new HttpClient(); |
97 | 93 | $response = $client->get($this->baseUrl, [ |
98 | 94 | 'query' => [ |
@@ -117,8 +113,7 @@ discard block |
||
117 | 113 | /** |
118 | 114 | * @test |
119 | 115 | */ |
120 | - public function canIdentify() |
|
121 | - { |
|
116 | + public function canIdentify() { |
|
122 | 117 | $oai = Endpoint::build($this->oaiUrl); |
123 | 118 | $identity = $oai->identify(); |
124 | 119 | |
@@ -131,8 +126,7 @@ discard block |
||
131 | 126 | /** |
132 | 127 | * @test |
133 | 128 | */ |
134 | - public function identifyGivesFallbackDatestampWhenNoDocuments() |
|
135 | - { |
|
129 | + public function identifyGivesFallbackDatestampWhenNoDocuments() { |
|
136 | 130 | $oai = Endpoint::build($this->oaiUrlNoStoragePid); |
137 | 131 | $identity = $oai->identify(); |
138 | 132 | |
@@ -142,8 +136,7 @@ discard block |
||
142 | 136 | /** |
143 | 137 | * @test |
144 | 138 | */ |
145 | - public function canListMetadataFormats() |
|
146 | - { |
|
139 | + public function canListMetadataFormats() { |
|
147 | 140 | $oai = Endpoint::build($this->oaiUrl); |
148 | 141 | $formats = $oai->listMetadataFormats(); |
149 | 142 | |
@@ -158,8 +151,7 @@ discard block |
||
158 | 151 | /** |
159 | 152 | * @test |
160 | 153 | */ |
161 | - public function canListRecords() |
|
162 | - { |
|
154 | + public function canListRecords() { |
|
163 | 155 | $oai = Endpoint::build($this->oaiUrl); |
164 | 156 | $result = $oai->listRecords('mets'); |
165 | 157 | |
@@ -172,8 +164,7 @@ discard block |
||
172 | 164 | /** |
173 | 165 | * @test |
174 | 166 | */ |
175 | - public function noRecordsUntil1900() |
|
176 | - { |
|
167 | + public function noRecordsUntil1900() { |
|
177 | 168 | $this->expectException(OaipmhException::class); |
178 | 169 | $this->expectExceptionMessage('empty list'); |
179 | 170 | |
@@ -186,8 +177,7 @@ discard block |
||
186 | 177 | /** |
187 | 178 | * @test |
188 | 179 | */ |
189 | - public function canUseResumptionToken() |
|
190 | - { |
|
180 | + public function canUseResumptionToken() { |
|
191 | 181 | // NOTE: cursor and expirationDate are optional by the specification, |
192 | 182 | // but we include them in our implementation |
193 | 183 | |
@@ -245,8 +235,7 @@ discard block |
||
245 | 235 | /** |
246 | 236 | * @test |
247 | 237 | */ |
248 | - public function noResumptionTokenForCompleteList() |
|
249 | - { |
|
238 | + public function noResumptionTokenForCompleteList() { |
|
250 | 239 | $client = new HttpClient(); |
251 | 240 | |
252 | 241 | foreach (['ListIdentifiers', 'ListRecords'] as $verb) { |
@@ -268,8 +257,7 @@ discard block |
||
268 | 257 | /** |
269 | 258 | * @test |
270 | 259 | */ |
271 | - public function canListAndResumeIdentifiers() |
|
272 | - { |
|
260 | + public function canListAndResumeIdentifiers() { |
|
273 | 261 | $oai = Endpoint::build($this->oaiUrl); |
274 | 262 | $result = $oai->listIdentifiers('mets'); |
275 | 263 | |
@@ -282,18 +270,15 @@ discard block |
||
282 | 270 | $this->assertEquals('oai:de:slub-dresden:db:id-476248086', $record->identifier); |
283 | 271 | } |
284 | 272 | |
285 | - protected function parseUtc(string $dateTime) |
|
286 | - { |
|
273 | + protected function parseUtc(string $dateTime) { |
|
287 | 274 | return DateTime::createFromFormat('Y-m-d\TH:i:s\Z', $dateTime); |
288 | 275 | } |
289 | 276 | |
290 | - protected function assertUtcDateString(string $dateTime) |
|
291 | - { |
|
277 | + protected function assertUtcDateString(string $dateTime) { |
|
292 | 278 | $this->assertInstanceOf(DateTime::class, $this->parseUtc($dateTime)); |
293 | 279 | } |
294 | 280 | |
295 | - protected function assertInFuture(string $dateTime) |
|
296 | - { |
|
281 | + protected function assertInFuture(string $dateTime) { |
|
297 | 282 | $this->assertGreaterThan(new DateTime(), $this->parseUtc($dateTime)); |
298 | 283 | } |
299 | 284 | } |