@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | |
| 359 | 359 | $excludeOtherWhere = ''; |
| 360 | 360 | if ($settings['excludeOther']) { |
| 361 | - $excludeOtherWhere = 'tx_dlf_documents.pid=' . intval($settings['storagePid']); |
|
| 361 | + $excludeOtherWhere = 'tx_dlf_documents.pid='.intval($settings['storagePid']); |
|
| 362 | 362 | } |
| 363 | 363 | // Check if there are any metadata to suggest. |
| 364 | 364 | $result = $queryBuilder |
@@ -410,12 +410,12 @@ discard block |
||
| 410 | 410 | $connection = GeneralUtility::makeInstance(ConnectionPool::class) |
| 411 | 411 | ->getConnectionForTable('tx_dlf_documents'); |
| 412 | 412 | |
| 413 | - $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` ' . |
|
| 414 | - 'FROM `tx_dlf_documents` ' . |
|
| 415 | - 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` ' . |
|
| 416 | - 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` ' . |
|
| 417 | - 'WHERE `tx_dlf_documents`.`record_id` = ? ' . |
|
| 418 | - 'AND `tx_dlf_relations`.`ident`="docs_colls" ' . |
|
| 413 | + $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` '. |
|
| 414 | + 'FROM `tx_dlf_documents` '. |
|
| 415 | + 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` '. |
|
| 416 | + 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` '. |
|
| 417 | + 'WHERE `tx_dlf_documents`.`record_id` = ? '. |
|
| 418 | + 'AND `tx_dlf_relations`.`ident`="docs_colls" '. |
|
| 419 | 419 | $where; |
| 420 | 420 | |
| 421 | 421 | $values = [ |
@@ -445,13 +445,13 @@ discard block |
||
| 445 | 445 | $connection = GeneralUtility::makeInstance(ConnectionPool::class) |
| 446 | 446 | ->getConnectionForTable('tx_dlf_documents'); |
| 447 | 447 | |
| 448 | - $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` ' . |
|
| 449 | - 'FROM `tx_dlf_documents` ' . |
|
| 450 | - 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` ' . |
|
| 451 | - 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` ' . |
|
| 452 | - 'WHERE `tx_dlf_documents`.`uid` IN ( ? ) ' . |
|
| 453 | - 'AND `tx_dlf_relations`.`ident`="docs_colls" ' . |
|
| 454 | - 'AND ' . Helper::whereExpression('tx_dlf_collections') . ' ' . |
|
| 448 | + $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` '. |
|
| 449 | + 'FROM `tx_dlf_documents` '. |
|
| 450 | + 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` '. |
|
| 451 | + 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` '. |
|
| 452 | + 'WHERE `tx_dlf_documents`.`uid` IN ( ? ) '. |
|
| 453 | + 'AND `tx_dlf_relations`.`ident`="docs_colls" '. |
|
| 454 | + 'AND '.Helper::whereExpression('tx_dlf_collections').' '. |
|
| 455 | 455 | 'GROUP BY `tx_dlf_documents`.`uid` '; |
| 456 | 456 | |
| 457 | 457 | $values = [ |
@@ -533,13 +533,13 @@ discard block |
||
| 533 | 533 | // Set search query. |
| 534 | 534 | if ( |
| 535 | 535 | (!empty($searchParams['fulltext'])) |
| 536 | - || preg_match('/' . $fields['fulltext'] . ':\((.*)\)/', trim($searchParams['query']), $matches) |
|
| 536 | + || preg_match('/'.$fields['fulltext'].':\((.*)\)/', trim($searchParams['query']), $matches) |
|
| 537 | 537 | ) { |
| 538 | 538 | // If the query already is a fulltext query e.g using the facets |
| 539 | 539 | $searchParams['query'] = empty($matches[1]) ? $searchParams['query'] : $matches[1]; |
| 540 | 540 | // Search in fulltext field if applicable. Query must not be empty! |
| 541 | 541 | if (!empty($searchParams['query'])) { |
| 542 | - $query = $fields['fulltext'] . ':(' . Solr::escapeQuery(trim($searchParams['query'])) . ')'; |
|
| 542 | + $query = $fields['fulltext'].':('.Solr::escapeQuery(trim($searchParams['query'])).')'; |
|
| 543 | 543 | } |
| 544 | 544 | $params['fulltext'] = true; |
| 545 | 545 | } else { |
@@ -562,9 +562,9 @@ discard block |
||
| 562 | 562 | in_array($searchParams['extOperator'][$i], $allowedOperators) |
| 563 | 563 | ) { |
| 564 | 564 | if (!empty($query)) { |
| 565 | - $query .= ' ' . $searchParams['extOperator'][$i] . ' '; |
|
| 565 | + $query .= ' '.$searchParams['extOperator'][$i].' '; |
|
| 566 | 566 | } |
| 567 | - $query .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']) . ':(' . Solr::escapeQuery($searchParams['extQuery'][$i]) . ')'; |
|
| 567 | + $query .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']).':('.Solr::escapeQuery($searchParams['extQuery'][$i]).')'; |
|
| 568 | 568 | } |
| 569 | 569 | } |
| 570 | 570 | } |
@@ -584,22 +584,22 @@ discard block |
||
| 584 | 584 | ) { |
| 585 | 585 | // Search in document and all subordinates (valid for up to three levels of hierarchy). |
| 586 | 586 | $params['filterquery'][]['query'] = '_query_:"{!join from=' |
| 587 | - . $fields['uid'] . ' to=' . $fields['partof'] . '}' |
|
| 588 | - . $fields['uid'] . ':{!join from=' . $fields['uid'] . ' to=' . $fields['partof'] . '}' |
|
| 589 | - . $fields['uid'] . ':' . $searchParams['documentId'] . '"' . ' OR {!join from=' |
|
| 590 | - . $fields['uid'] . ' to=' . $fields['partof'] . '}' |
|
| 591 | - . $fields['uid'] . ':' . $searchParams['documentId'] . ' OR ' |
|
| 592 | - . $fields['uid'] . ':' . $searchParams['documentId']; |
|
| 587 | + . $fields['uid'].' to='.$fields['partof'].'}' |
|
| 588 | + . $fields['uid'].':{!join from='.$fields['uid'].' to='.$fields['partof'].'}' |
|
| 589 | + . $fields['uid'].':'.$searchParams['documentId'].'"'.' OR {!join from=' |
|
| 590 | + . $fields['uid'].' to='.$fields['partof'].'}' |
|
| 591 | + . $fields['uid'].':'.$searchParams['documentId'].' OR ' |
|
| 592 | + . $fields['uid'].':'.$searchParams['documentId']; |
|
| 593 | 593 | } |
| 594 | 594 | |
| 595 | 595 | // if a collection is given, we prepare the collection query string |
| 596 | 596 | if ($collection) { |
| 597 | 597 | if ($collection instanceof \Kitodo\Dlf\Domain\Model\Collection) { |
| 598 | - $collectionsQueryString = '"' . $collection->getIndexName() . '"'; |
|
| 598 | + $collectionsQueryString = '"'.$collection->getIndexName().'"'; |
|
| 599 | 599 | } else { |
| 600 | 600 | $collectionsQueryString = ''; |
| 601 | 601 | foreach ($collection as $index => $collectionEntry) { |
| 602 | - $collectionsQueryString .= ($index > 0 ? ' OR ' : '') . '"' . $collectionEntry->getIndexName() . '"'; |
|
| 602 | + $collectionsQueryString .= ($index > 0 ? ' OR ' : '').'"'.$collectionEntry->getIndexName().'"'; |
|
| 603 | 603 | } |
| 604 | 604 | } |
| 605 | 605 | |
@@ -607,7 +607,7 @@ discard block |
||
| 607 | 607 | $params['filterquery'][]['query'] = 'toplevel:true'; |
| 608 | 608 | $params['filterquery'][]['query'] = 'partof:0'; |
| 609 | 609 | } |
| 610 | - $params['filterquery'][]['query'] = 'collection_faceting:(' . $collectionsQueryString . ')'; |
|
| 610 | + $params['filterquery'][]['query'] = 'collection_faceting:('.$collectionsQueryString.')'; |
|
| 611 | 611 | } |
| 612 | 612 | |
| 613 | 613 | // Set some query parameters. |
@@ -636,8 +636,8 @@ discard block |
||
| 636 | 636 | if ($listedMetadata) { |
| 637 | 637 | foreach ($listedMetadata as $metadata) { |
| 638 | 638 | if ($metadata->getIndexStored() || $metadata->getIndexIndexed()) { |
| 639 | - $listMetadataRecord = $metadata->getIndexName() . '_' . ($metadata->getIndexTokenized() ? 't' : 'u') . ($metadata->getIndexStored() ? 's' : 'u') . ($metadata->getIndexIndexed() ? 'i' : 'u'); |
|
| 640 | - $params['fields'] .= ',' . $listMetadataRecord; |
|
| 639 | + $listMetadataRecord = $metadata->getIndexName().'_'.($metadata->getIndexTokenized() ? 't' : 'u').($metadata->getIndexStored() ? 's' : 'u').($metadata->getIndexIndexed() ? 'i' : 'u'); |
|
| 640 | + $params['fields'] .= ','.$listMetadataRecord; |
|
| 641 | 641 | $params['listMetadataRecords'][$metadata->getIndexName()] = $listMetadataRecord; |
| 642 | 642 | } |
| 643 | 643 | } |
@@ -723,7 +723,7 @@ discard block |
||
| 723 | 723 | if (empty($documents[$doc['uid']]['title']) && ($documents[$doc['uid']]['partOf'] > 0)) { |
| 724 | 724 | $parentDocument = $this->findByUid($documents[$doc['uid']]['partOf']); |
| 725 | 725 | if ($parentDocument) { |
| 726 | - $documents[$doc['uid']]['title'] = '[' . $parentDocument->getTitle() . ']'; |
|
| 726 | + $documents[$doc['uid']]['title'] = '['.$parentDocument->getTitle().']'; |
|
| 727 | 727 | } |
| 728 | 728 | } |
| 729 | 729 | } |
@@ -747,7 +747,7 @@ discard block |
||
| 747 | 747 | $metadataArray = []; |
| 748 | 748 | |
| 749 | 749 | // Set some query parameters. |
| 750 | - $params['query'] = 'uid:' . $uid; |
|
| 750 | + $params['query'] = 'uid:'.$uid; |
|
| 751 | 751 | $params['start'] = 0; |
| 752 | 752 | $params['rows'] = 1; |
| 753 | 753 | $params['sort'] = ['score' => 'desc']; |
@@ -759,8 +759,8 @@ discard block |
||
| 759 | 759 | if ($listedMetadata) { |
| 760 | 760 | foreach ($listedMetadata as $metadata) { |
| 761 | 761 | if ($metadata->getIndexStored() || $metadata->getIndexIndexed()) { |
| 762 | - $listMetadataRecord = $metadata->getIndexName() . '_' . ($metadata->getIndexTokenized() ? 't' : 'u') . ($metadata->getIndexStored() ? 's' : 'u') . ($metadata->getIndexIndexed() ? 'i' : 'u'); |
|
| 763 | - $params['fields'] .= ',' . $listMetadataRecord; |
|
| 762 | + $listMetadataRecord = $metadata->getIndexName().'_'.($metadata->getIndexTokenized() ? 't' : 'u').($metadata->getIndexStored() ? 's' : 'u').($metadata->getIndexIndexed() ? 'i' : 'u'); |
|
| 763 | + $params['fields'] .= ','.$listMetadataRecord; |
|
| 764 | 764 | $params['listMetadataRecords'][$metadata->getIndexName()] = $listMetadataRecord; |
| 765 | 765 | } |
| 766 | 766 | } |
@@ -810,7 +810,7 @@ discard block |
||
| 810 | 810 | $cache = null; |
| 811 | 811 | // Calculate cache identifier. |
| 812 | 812 | if ($enableCache === true) { |
| 813 | - $cacheIdentifier = Helper::digest($solr->core . print_r($parameters, true)); |
|
| 813 | + $cacheIdentifier = Helper::digest($solr->core.print_r($parameters, true)); |
|
| 814 | 814 | $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('tx_dlf_solr'); |
| 815 | 815 | } |
| 816 | 816 | $resultSet = [ |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $this->configurationToUseInTestInstance['EXTENSIONS']['dlf'] = $this->getDlfConfiguration(); |
| 72 | 72 | |
| 73 | 73 | if ($this->disableJsonWrappedResponse) { |
| 74 | - $this->frameworkExtensionsToLoad = array_filter($this->frameworkExtensionsToLoad, function ($ext) { |
|
| 74 | + $this->frameworkExtensionsToLoad = array_filter($this->frameworkExtensionsToLoad, function($ext) { |
|
| 75 | 75 | return $ext !== 'Resources/Core/Functional/Extensions/json_response'; |
| 76 | 76 | }); |
| 77 | 77 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class); |
| 85 | 85 | |
| 86 | - $this->baseUrl = 'http://web:8000/public/typo3temp/var/tests/functional-' . $this->identifier . '/'; |
|
| 86 | + $this->baseUrl = 'http://web:8000/public/typo3temp/var/tests/functional-'.$this->identifier.'/'; |
|
| 87 | 87 | $this->httpClient = new HttpClient([ |
| 88 | 88 | 'base_uri' => $this->baseUrl, |
| 89 | 89 | 'http_errors' => false, |
@@ -127,13 +127,13 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | protected function addSiteConfig($identifier, $baseUrl) |
| 129 | 129 | { |
| 130 | - $siteConfig = Yaml::parseFile(__DIR__ . '/../Fixtures/siteconfig.yaml'); |
|
| 130 | + $siteConfig = Yaml::parseFile(__DIR__.'/../Fixtures/siteconfig.yaml'); |
|
| 131 | 131 | $siteConfig['base'] = $baseUrl; |
| 132 | 132 | $siteConfig['languages'][0]['base'] = $baseUrl; |
| 133 | 133 | |
| 134 | - $siteConfigPath = $this->instancePath . '/typo3conf/sites/' . $identifier; |
|
| 134 | + $siteConfigPath = $this->instancePath.'/typo3conf/sites/'.$identifier; |
|
| 135 | 135 | @mkdir($siteConfigPath, 0775, true); |
| 136 | - file_put_contents($siteConfigPath . '/config.yaml', Yaml::dump($siteConfig)); |
|
| 136 | + file_put_contents($siteConfigPath.'/config.yaml', Yaml::dump($siteConfig)); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | protected function initializeRepository(string $className, int $storagePid) |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | $jsonDocuments = json_decode(file_get_contents($path), true); |
| 153 | 153 | |
| 154 | 154 | $updateQuery = $solr->service->createUpdate(); |
| 155 | - $documents = array_map(function ($jsonDoc) use ($updateQuery) { |
|
| 155 | + $documents = array_map(function($jsonDoc) use ($updateQuery) { |
|
| 156 | 156 | $document = $updateQuery->createDocument(); |
| 157 | 157 | foreach ($jsonDoc as $key => $value) { |
| 158 | 158 | $document->setField($key, $value); |
@@ -64,8 +64,7 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | protected $httpClient; |
| 66 | 66 | |
| 67 | - public function __construct() |
|
| 68 | - { |
|
| 67 | + public function __construct() { |
|
| 69 | 68 | parent::__construct(); |
| 70 | 69 | |
| 71 | 70 | $this->configurationToUseInTestInstance['EXTENSIONS']['dlf'] = $this->getDlfConfiguration(); |
@@ -92,8 +91,7 @@ discard block |
||
| 92 | 91 | $this->addSiteConfig('dlf-testing', $this->baseUrl); |
| 93 | 92 | } |
| 94 | 93 | |
| 95 | - protected function getDlfConfiguration() |
|
| 96 | - { |
|
| 94 | + protected function getDlfConfiguration() { |
|
| 97 | 95 | return [ |
| 98 | 96 | 'solrFieldAutocomplete' => 'autocomplete', |
| 99 | 97 | 'solrFieldCollection' => 'collection', |
@@ -125,8 +123,7 @@ discard block |
||
| 125 | 123 | ]; |
| 126 | 124 | } |
| 127 | 125 | |
| 128 | - protected function addSiteConfig($identifier, $baseUrl) |
|
| 129 | - { |
|
| 126 | + protected function addSiteConfig($identifier, $baseUrl) { |
|
| 130 | 127 | $siteConfig = Yaml::parseFile(__DIR__ . '/../Fixtures/siteconfig.yaml'); |
| 131 | 128 | $siteConfig['base'] = $baseUrl; |
| 132 | 129 | $siteConfig['languages'][0]['base'] = $baseUrl; |
@@ -136,8 +133,7 @@ discard block |
||
| 136 | 133 | file_put_contents($siteConfigPath . '/config.yaml', Yaml::dump($siteConfig)); |
| 137 | 134 | } |
| 138 | 135 | |
| 139 | - protected function initializeRepository(string $className, int $storagePid) |
|
| 140 | - { |
|
| 136 | + protected function initializeRepository(string $className, int $storagePid) { |
|
| 141 | 137 | $repository = $this->objectManager->get($className); |
| 142 | 138 | |
| 143 | 139 | $querySettings = $this->objectManager->get(Typo3QuerySettings::class); |
@@ -147,8 +143,7 @@ discard block |
||
| 147 | 143 | return $repository; |
| 148 | 144 | } |
| 149 | 145 | |
| 150 | - protected function importSolrDocuments(Solr $solr, string $path) |
|
| 151 | - { |
|
| 146 | + protected function importSolrDocuments(Solr $solr, string $path) { |
|
| 152 | 147 | $jsonDocuments = json_decode(file_get_contents($path), true); |
| 153 | 148 | |
| 154 | 149 | $updateQuery = $solr->service->createUpdate(); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | * |
| 50 | 50 | * @var bool |
| 51 | 51 | */ |
| 52 | - protected $disableJsonWrappedResponse = false; |
|
| 52 | + protected $disableJsonWrappedResponse = FALSE; |
|
| 53 | 53 | |
| 54 | 54 | /** @var ObjectManager */ |
| 55 | 55 | protected $objectManager; |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $this->baseUrl = 'http://web:8000/public/typo3temp/var/tests/functional-' . $this->identifier . '/'; |
| 87 | 87 | $this->httpClient = new HttpClient([ |
| 88 | 88 | 'base_uri' => $this->baseUrl, |
| 89 | - 'http_errors' => false, |
|
| 89 | + 'http_errors' => FALSE, |
|
| 90 | 90 | ]); |
| 91 | 91 | |
| 92 | 92 | $this->addSiteConfig('dlf-testing', $this->baseUrl); |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | $siteConfig['languages'][0]['base'] = $baseUrl; |
| 133 | 133 | |
| 134 | 134 | $siteConfigPath = $this->instancePath . '/typo3conf/sites/' . $identifier; |
| 135 | - @mkdir($siteConfigPath, 0775, true); |
|
| 135 | + @mkdir($siteConfigPath, 0775, TRUE); |
|
| 136 | 136 | file_put_contents($siteConfigPath . '/config.yaml', Yaml::dump($siteConfig)); |
| 137 | 137 | } |
| 138 | 138 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | protected function importSolrDocuments(Solr $solr, string $path) |
| 151 | 151 | { |
| 152 | - $jsonDocuments = json_decode(file_get_contents($path), true); |
|
| 152 | + $jsonDocuments = json_decode(file_get_contents($path), TRUE); |
|
| 153 | 153 | |
| 154 | 154 | $updateQuery = $solr->service->createUpdate(); |
| 155 | 155 | $documents = array_map(function ($jsonDoc) use ($updateQuery) { |
@@ -37,15 +37,15 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | parent::setUp(); |
| 39 | 39 | |
| 40 | - $this->oaiUrl = $this->baseUrl . '/index.php?id=' . $this->oaiPage; |
|
| 41 | - $this->oaiUrlNoStoragePid = $this->baseUrl . '/index.php?id=' . $this->oaiPageNoStoragePid; |
|
| 40 | + $this->oaiUrl = $this->baseUrl.'/index.php?id='.$this->oaiPage; |
|
| 41 | + $this->oaiUrlNoStoragePid = $this->baseUrl.'/index.php?id='.$this->oaiPageNoStoragePid; |
|
| 42 | 42 | |
| 43 | - $this->importDataSet(__DIR__ . '/../../Fixtures/Common/documents_1.xml'); |
|
| 44 | - $this->importDataSet(__DIR__ . '/../../Fixtures/Common/metadata.xml'); |
|
| 45 | - $this->importDataSet(__DIR__ . '/../../Fixtures/Common/libraries.xml'); |
|
| 46 | - $this->importDataSet(__DIR__ . '/../../Fixtures/Common/pages.xml'); |
|
| 47 | - $this->importDataSet(__DIR__ . '/../../Fixtures/OaiPmh/pages.xml'); |
|
| 48 | - $this->importDataSet(__DIR__ . '/../../Fixtures/OaiPmh/solrcores.xml'); |
|
| 43 | + $this->importDataSet(__DIR__.'/../../Fixtures/Common/documents_1.xml'); |
|
| 44 | + $this->importDataSet(__DIR__.'/../../Fixtures/Common/metadata.xml'); |
|
| 45 | + $this->importDataSet(__DIR__.'/../../Fixtures/Common/libraries.xml'); |
|
| 46 | + $this->importDataSet(__DIR__.'/../../Fixtures/Common/pages.xml'); |
|
| 47 | + $this->importDataSet(__DIR__.'/../../Fixtures/OaiPmh/pages.xml'); |
|
| 48 | + $this->importDataSet(__DIR__.'/../../Fixtures/OaiPmh/solrcores.xml'); |
|
| 49 | 49 | |
| 50 | 50 | $this->persistenceManager = $this->objectManager->get(PersistenceManager::class); |
| 51 | 51 | $this->solrCoreRepository = $this->initializeRepository(SolrCoreRepository::class, 20000); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $coreName = Solr::createCore(); |
| 63 | 63 | $solr = Solr::getInstance($coreName); |
| 64 | 64 | |
| 65 | - $this->importSolrDocuments($solr, __DIR__ . '/../../Fixtures/Common/documents_1.solr.json'); |
|
| 65 | + $this->importSolrDocuments($solr, __DIR__.'/../../Fixtures/Common/documents_1.solr.json'); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | $oaiCoreModel = $this->solrCoreRepository->findByUid(11001); |
@@ -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 | |
@@ -74,8 +72,7 @@ discard block |
||
| 74 | 72 | /** |
| 75 | 73 | * @test |
| 76 | 74 | */ |
| 77 | - public function correctlyRespondsOnBadVerb() |
|
| 78 | - { |
|
| 75 | + public function correctlyRespondsOnBadVerb() { |
|
| 79 | 76 | $client = new HttpClient(); |
| 80 | 77 | $response = $client->get($this->baseUrl, [ |
| 81 | 78 | 'query' => [ |
@@ -100,8 +97,7 @@ discard block |
||
| 100 | 97 | /** |
| 101 | 98 | * @test |
| 102 | 99 | */ |
| 103 | - public function canIdentify() |
|
| 104 | - { |
|
| 100 | + public function canIdentify() { |
|
| 105 | 101 | $oai = Endpoint::build($this->oaiUrl); |
| 106 | 102 | $identity = $oai->identify(); |
| 107 | 103 | |
@@ -114,8 +110,7 @@ discard block |
||
| 114 | 110 | /** |
| 115 | 111 | * @test |
| 116 | 112 | */ |
| 117 | - public function identifyGivesFallbackDatestampWhenNoDocuments() |
|
| 118 | - { |
|
| 113 | + public function identifyGivesFallbackDatestampWhenNoDocuments() { |
|
| 119 | 114 | $oai = Endpoint::build($this->oaiUrlNoStoragePid); |
| 120 | 115 | $identity = $oai->identify(); |
| 121 | 116 | |
@@ -125,8 +120,7 @@ discard block |
||
| 125 | 120 | /** |
| 126 | 121 | * @test |
| 127 | 122 | */ |
| 128 | - public function canListMetadataFormats() |
|
| 129 | - { |
|
| 123 | + public function canListMetadataFormats() { |
|
| 130 | 124 | $oai = Endpoint::build($this->oaiUrl); |
| 131 | 125 | $formats = $oai->listMetadataFormats(); |
| 132 | 126 | |
@@ -141,8 +135,7 @@ discard block |
||
| 141 | 135 | /** |
| 142 | 136 | * @test |
| 143 | 137 | */ |
| 144 | - public function canListRecords() |
|
| 145 | - { |
|
| 138 | + public function canListRecords() { |
|
| 146 | 139 | $oai = Endpoint::build($this->oaiUrl); |
| 147 | 140 | $result = $oai->listRecords('mets'); |
| 148 | 141 | |
@@ -155,8 +148,7 @@ discard block |
||
| 155 | 148 | /** |
| 156 | 149 | * @test |
| 157 | 150 | */ |
| 158 | - public function noRecordsUntil1900() |
|
| 159 | - { |
|
| 151 | + public function noRecordsUntil1900() { |
|
| 160 | 152 | $this->expectException(OaipmhException::class); |
| 161 | 153 | $this->expectExceptionMessage('empty list'); |
| 162 | 154 | |
@@ -169,8 +161,7 @@ discard block |
||
| 169 | 161 | /** |
| 170 | 162 | * @test |
| 171 | 163 | */ |
| 172 | - public function canUseResumptionToken() |
|
| 173 | - { |
|
| 164 | + public function canUseResumptionToken() { |
|
| 174 | 165 | // NOTE: cursor and expirationDate are optional by the specification, |
| 175 | 166 | // but we include them in our implementation |
| 176 | 167 | |
@@ -228,8 +219,7 @@ discard block |
||
| 228 | 219 | /** |
| 229 | 220 | * @test |
| 230 | 221 | */ |
| 231 | - public function noResumptionTokenForCompleteList() |
|
| 232 | - { |
|
| 222 | + public function noResumptionTokenForCompleteList() { |
|
| 233 | 223 | $client = new HttpClient(); |
| 234 | 224 | |
| 235 | 225 | foreach (['ListIdentifiers', 'ListRecords'] as $verb) { |
@@ -251,8 +241,7 @@ discard block |
||
| 251 | 241 | /** |
| 252 | 242 | * @test |
| 253 | 243 | */ |
| 254 | - public function canListAndResumeIdentifiers() |
|
| 255 | - { |
|
| 244 | + public function canListAndResumeIdentifiers() { |
|
| 256 | 245 | $oai = Endpoint::build($this->oaiUrl); |
| 257 | 246 | $result = $oai->listIdentifiers('mets'); |
| 258 | 247 | |
@@ -265,18 +254,15 @@ discard block |
||
| 265 | 254 | $this->assertEquals('oai:de:slub-dresden:db:id-476248086', $record->identifier); |
| 266 | 255 | } |
| 267 | 256 | |
| 268 | - protected function parseUtc(string $dateTime) |
|
| 269 | - { |
|
| 257 | + protected function parseUtc(string $dateTime) { |
|
| 270 | 258 | return DateTime::createFromFormat('Y-m-d\TH:i:s\Z', $dateTime); |
| 271 | 259 | } |
| 272 | 260 | |
| 273 | - protected function assertUtcDateString(string $dateTime) |
|
| 274 | - { |
|
| 261 | + protected function assertUtcDateString(string $dateTime) { |
|
| 275 | 262 | $this->assertInstanceOf(DateTime::class, $this->parseUtc($dateTime)); |
| 276 | 263 | } |
| 277 | 264 | |
| 278 | - protected function assertInFuture(string $dateTime) |
|
| 279 | - { |
|
| 265 | + protected function assertInFuture(string $dateTime) { |
|
| 280 | 266 | $this->assertGreaterThan(new DateTime(), $this->parseUtc($dateTime)); |
| 281 | 267 | } |
| 282 | 268 | } |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | class OaiPmhTest extends FunctionalTestCase |
| 16 | 16 | { |
| 17 | - protected $disableJsonWrappedResponse = true; |
|
| 17 | + protected $disableJsonWrappedResponse = TRUE; |
|
| 18 | 18 | |
| 19 | 19 | protected $coreExtensionsToLoad = [ |
| 20 | 20 | 'fluid', |
@@ -56,9 +56,9 @@ discard block |
||
| 56 | 56 | protected function setUpOaiSolr() |
| 57 | 57 | { |
| 58 | 58 | // Setup Solr only once for all tests in this suite |
| 59 | - static $solr = null; |
|
| 59 | + static $solr = NULL; |
|
| 60 | 60 | |
| 61 | - if ($solr === null) { |
|
| 61 | + if ($solr === NULL) { |
|
| 62 | 62 | $coreName = Solr::createCore(); |
| 63 | 63 | $solr = Solr::getInstance($coreName); |
| 64 | 64 | |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $this->expectExceptionMessage('empty list'); |
| 162 | 162 | |
| 163 | 163 | $oai = Endpoint::build($this->oaiUrl); |
| 164 | - $result = $oai->listRecords('mets', null, (new DateTime())->setDate(1900, 1, 1)); |
|
| 164 | + $result = $oai->listRecords('mets', NULL, (new DateTime())->setDate(1900, 1, 1)); |
|
| 165 | 165 | |
| 166 | 166 | $result->current(); |
| 167 | 167 | } |
@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | $this->documentRepository = $this->initializeRepository(DocumentRepository::class, 20000); |
| 44 | 44 | $this->solrCoreRepository = $this->initializeRepository(SolrCoreRepository::class, 20000); |
| 45 | 45 | |
| 46 | - $this->importDataSet(__DIR__ . '/../../Fixtures/Common/documents_1.xml'); |
|
| 47 | - $this->importDataSet(__DIR__ . '/../../Fixtures/Common/libraries.xml'); |
|
| 48 | - $this->importDataSet(__DIR__ . '/../../Fixtures/Common/metadata.xml'); |
|
| 46 | + $this->importDataSet(__DIR__.'/../../Fixtures/Common/documents_1.xml'); |
|
| 47 | + $this->importDataSet(__DIR__.'/../../Fixtures/Common/libraries.xml'); |
|
| 48 | + $this->importDataSet(__DIR__.'/../../Fixtures/Common/metadata.xml'); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -112,9 +112,9 @@ discard block |
||
| 112 | 112 | { |
| 113 | 113 | $core = $this->createSolrCore(); |
| 114 | 114 | |
| 115 | - $this->importDataSet(__DIR__ . '/../../Fixtures/Common/documents_fulltext.xml'); |
|
| 116 | - $this->importSolrDocuments($core->solr, __DIR__ . '/../../Fixtures/Common/documents_1.solr.json'); |
|
| 117 | - $this->importSolrDocuments($core->solr, __DIR__ . '/../../Fixtures/Common/documents_fulltext.solr.json'); |
|
| 115 | + $this->importDataSet(__DIR__.'/../../Fixtures/Common/documents_fulltext.xml'); |
|
| 116 | + $this->importSolrDocuments($core->solr, __DIR__.'/../../Fixtures/Common/documents_1.solr.json'); |
|
| 117 | + $this->importSolrDocuments($core->solr, __DIR__.'/../../Fixtures/Common/documents_fulltext.solr.json'); |
|
| 118 | 118 | |
| 119 | 119 | $collections = $this->collectionRepository->findCollectionsBySettings([ |
| 120 | 120 | 'index_name' => ['Musik', 'Projekt: Dresdner Hefte'], |
@@ -16,8 +16,7 @@ discard block |
||
| 16 | 16 | use TYPO3\CMS\Extbase\Object\ObjectManager; |
| 17 | 17 | use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager; |
| 18 | 18 | |
| 19 | -class SolrIndexingTest extends FunctionalTestCase |
|
| 20 | -{ |
|
| 19 | +class SolrIndexingTest extends FunctionalTestCase { |
|
| 21 | 20 | /** @var PersistenceManager */ |
| 22 | 21 | protected $persistenceManager; |
| 23 | 22 | |
@@ -51,8 +50,7 @@ discard block |
||
| 51 | 50 | /** |
| 52 | 51 | * @test |
| 53 | 52 | */ |
| 54 | - public function canCreateCore() |
|
| 55 | - { |
|
| 53 | + public function canCreateCore() { |
|
| 56 | 54 | $coreName = uniqid('testCore'); |
| 57 | 55 | $solr = Solr::getInstance($coreName); |
| 58 | 56 | $this->assertNull($solr->core); |
@@ -67,8 +65,7 @@ discard block |
||
| 67 | 65 | /** |
| 68 | 66 | * @test |
| 69 | 67 | */ |
| 70 | - public function canIndexAndSearchDocument() |
|
| 71 | - { |
|
| 68 | + public function canIndexAndSearchDocument() { |
|
| 72 | 69 | $core = $this->createSolrCore(); |
| 73 | 70 | |
| 74 | 71 | $document = $this->documentRepository->findByUid(1001); |
@@ -108,8 +105,7 @@ discard block |
||
| 108 | 105 | /** |
| 109 | 106 | * @test |
| 110 | 107 | */ |
| 111 | - public function canSearchInCollections() |
|
| 112 | - { |
|
| 108 | + public function canSearchInCollections() { |
|
| 113 | 109 | $core = $this->createSolrCore(); |
| 114 | 110 | |
| 115 | 111 | $this->importDataSet(__DIR__ . '/../../Fixtures/Common/documents_fulltext.xml'); |