@@ -18,8 +18,7 @@ |
||
18 | 18 | /** |
19 | 19 | * @covers StdWrapViewHelper |
20 | 20 | */ |
21 | -class StdWrapViewHelperTest extends FunctionalTestCase |
|
22 | -{ |
|
21 | +class StdWrapViewHelperTest extends FunctionalTestCase { |
|
23 | 22 | /** |
24 | 23 | * @var bool Speed up this test case, it needs no database |
25 | 24 | */ |
@@ -25,7 +25,7 @@ |
||
25 | 25 | /** |
26 | 26 | * @var bool Speed up this test case, it needs no database |
27 | 27 | */ |
28 | - protected $initializeDatabase = false; |
|
28 | + protected $initializeDatabase = FALSE; |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * @test |
@@ -21,8 +21,8 @@ |
||
21 | 21 | { |
22 | 22 | parent::setUp(); |
23 | 23 | |
24 | - $this->importCSVDataSet(__DIR__ . '/../../Fixtures/Common/libraries.csv'); |
|
25 | - $this->importCSVDataSet(__DIR__ . '/../../Fixtures/Common/metadata.csv'); |
|
24 | + $this->importCSVDataSet(__DIR__.'/../../Fixtures/Common/libraries.csv'); |
|
25 | + $this->importCSVDataSet(__DIR__.'/../../Fixtures/Common/metadata.csv'); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -15,8 +15,7 @@ discard block |
||
15 | 15 | use Kitodo\Dlf\Common\Helper; |
16 | 16 | use Kitodo\Dlf\Tests\Functional\FunctionalTestCase; |
17 | 17 | |
18 | -class HelperTest extends FunctionalTestCase |
|
19 | -{ |
|
18 | +class HelperTest extends FunctionalTestCase { |
|
20 | 19 | public function setUp(): void |
21 | 20 | { |
22 | 21 | parent::setUp(); |
@@ -28,8 +27,7 @@ discard block |
||
28 | 27 | /** |
29 | 28 | * @test |
30 | 29 | */ |
31 | - public function canGetIndexNameFromUid() |
|
32 | - { |
|
30 | + public function canGetIndexNameFromUid() { |
|
33 | 31 | // Repeat to make sure caching isn't broken |
34 | 32 | for ($n = 0; $n < 2; $n++) { |
35 | 33 | // Good UID, no PID |
@@ -78,8 +76,7 @@ discard block |
||
78 | 76 | * @test |
79 | 77 | * @group getLanguageName |
80 | 78 | */ |
81 | - public function canTranslateLanguageNameToEnglish() |
|
82 | - { |
|
79 | + public function canTranslateLanguageNameToEnglish() { |
|
83 | 80 | // NOTE: This only tests in BE mode |
84 | 81 | |
85 | 82 | $this->initLanguageService('default'); |
@@ -93,8 +90,7 @@ discard block |
||
93 | 90 | * @test |
94 | 91 | * @group getLanguageName |
95 | 92 | */ |
96 | - public function canTranslateLanguageNameToGerman() |
|
97 | - { |
|
93 | + public function canTranslateLanguageNameToGerman() { |
|
98 | 94 | // NOTE: This only tests in BE mode |
99 | 95 | |
100 | 96 | $this->initLanguageService('de'); |
@@ -15,14 +15,12 @@ |
||
15 | 15 | use Kitodo\Dlf\Common\IiifUrlReader; |
16 | 16 | use Kitodo\Dlf\Tests\Functional\FunctionalTestCase; |
17 | 17 | |
18 | -class IiifUrlReaderTest extends FunctionalTestCase |
|
19 | -{ |
|
18 | +class IiifUrlReaderTest extends FunctionalTestCase { |
|
20 | 19 | /** |
21 | 20 | * @test |
22 | 21 | * @group getContent |
23 | 22 | */ |
24 | - public function getContentCheck() |
|
25 | - { |
|
23 | + public function getContentCheck() { |
|
26 | 24 | $iiifUrlReader = new IiifUrlReader(); |
27 | 25 | |
28 | 26 | $correctUrl = 'http://web:8001/Tests/Fixtures/Common/correct.txt'; |
@@ -21,11 +21,11 @@ |
||
21 | 21 | class SolrSearchTest extends FunctionalTestCase |
22 | 22 | { |
23 | 23 | private static array $databaseFixtures = [ |
24 | - __DIR__ . '/../../Fixtures/Common/solrcores.csv' |
|
24 | + __DIR__.'/../../Fixtures/Common/solrcores.csv' |
|
25 | 25 | ]; |
26 | 26 | |
27 | 27 | private static array $solrFixtures = [ |
28 | - __DIR__ . '/../../Fixtures/Common/documents_1.solr.json' |
|
28 | + __DIR__.'/../../Fixtures/Common/documents_1.solr.json' |
|
29 | 29 | ]; |
30 | 30 | |
31 | 31 | private Solr $solr; |
@@ -18,8 +18,7 @@ discard block |
||
18 | 18 | use Kitodo\Dlf\Domain\Repository\SolrCoreRepository; |
19 | 19 | use Kitodo\Dlf\Tests\Functional\FunctionalTestCase; |
20 | 20 | |
21 | -class SolrSearchTest extends FunctionalTestCase |
|
22 | -{ |
|
21 | +class SolrSearchTest extends FunctionalTestCase { |
|
23 | 22 | private static array $databaseFixtures = [ |
24 | 23 | __DIR__ . '/../../Fixtures/Common/solrcores.csv' |
25 | 24 | ]; |
@@ -41,8 +40,7 @@ discard block |
||
41 | 40 | /** |
42 | 41 | * @test |
43 | 42 | */ |
44 | - public function canPrepareAndSubmit() |
|
45 | - { |
|
43 | + public function canPrepareAndSubmit() { |
|
46 | 44 | $documentRepository = $this->initializeRepository(DocumentRepository::class, 0); |
47 | 45 | $solrCoreName = $this->solrCoreRepository->findByUid(5)->getIndexName(); |
48 | 46 | $settings = ['solrcore' => $solrCoreName, 'storagePid' => 0]; |
@@ -80,8 +78,7 @@ discard block |
||
80 | 78 | $this->initializeRepository(DocumentRepository::class, 0); |
81 | 79 | } |
82 | 80 | |
83 | - protected function setUpSolr($uid, $storagePid, $solrFixtures) |
|
84 | - { |
|
81 | + protected function setUpSolr($uid, $storagePid, $solrFixtures) { |
|
85 | 82 | $this->solrCoreRepository = $this->initializeRepository(SolrCoreRepository::class, $storagePid); |
86 | 83 | |
87 | 84 | // Setup Solr only once for all tests in this suite |
@@ -51,21 +51,21 @@ discard block |
||
51 | 51 | $this->assertCount(33, $resultSet); |
52 | 52 | |
53 | 53 | $params1 = ['query' => '*']; |
54 | - $search = new SolrSearch($documentRepository, null, $settings, $params1); |
|
54 | + $search = new SolrSearch($documentRepository, NULL, $settings, $params1); |
|
55 | 55 | $search->prepare(); |
56 | 56 | $this->assertEquals(33, $search->getNumFound()); |
57 | 57 | $this->assertEquals(3, $search->getSolrResults()['numberOfToplevels']); |
58 | 58 | $this->assertCount(15, $search->getSolrResults()['documents']); |
59 | 59 | |
60 | 60 | $params2 = ['query' => '10 Keyboard pieces']; |
61 | - $search2 = new SolrSearch($documentRepository, null, $settings, $params2); |
|
61 | + $search2 = new SolrSearch($documentRepository, NULL, $settings, $params2); |
|
62 | 62 | $search2->prepare(); |
63 | 63 | $this->assertEquals(1, $search2->getNumFound()); |
64 | 64 | $this->assertEquals(1, $search2->getSolrResults()['numberOfToplevels']); |
65 | 65 | $this->assertCount(1, $search2->getSolrResults()['documents']); |
66 | 66 | |
67 | 67 | $params3 = ['query' => 'foobar']; |
68 | - $search3 = new SolrSearch($documentRepository, null, $settings, $params3); |
|
68 | + $search3 = new SolrSearch($documentRepository, NULL, $settings, $params3); |
|
69 | 69 | $search3->prepare(); |
70 | 70 | $this->assertEquals(0, $search3->getNumFound()); |
71 | 71 | $this->assertEquals(0, $search3->getSolrResults()['numberOfToplevels']); |
@@ -85,9 +85,9 @@ discard block |
||
85 | 85 | $this->solrCoreRepository = $this->initializeRepository(SolrCoreRepository::class, $storagePid); |
86 | 86 | |
87 | 87 | // Setup Solr only once for all tests in this suite |
88 | - static $solr = null; |
|
88 | + static $solr = NULL; |
|
89 | 89 | |
90 | - if ($solr === null) { |
|
90 | + if ($solr === NULL) { |
|
91 | 91 | $coreName = Solr::createCore(); |
92 | 92 | $solr = Solr::getInstance($coreName); |
93 | 93 | foreach ($solrFixtures as $filePath) { |
@@ -45,9 +45,9 @@ discard block |
||
45 | 45 | $this->documentRepository = $this->initializeRepository(DocumentRepository::class, 20000); |
46 | 46 | $this->solrCoreRepository = $this->initializeRepository(SolrCoreRepository::class, 20000); |
47 | 47 | |
48 | - $this->importCSVDataSet(__DIR__ . '/../../Fixtures/Common/documents_1.csv'); |
|
49 | - $this->importCSVDataSet(__DIR__ . '/../../Fixtures/Common/libraries.csv'); |
|
50 | - $this->importCSVDataSet(__DIR__ . '/../../Fixtures/Common/metadata.csv'); |
|
48 | + $this->importCSVDataSet(__DIR__.'/../../Fixtures/Common/documents_1.csv'); |
|
49 | + $this->importCSVDataSet(__DIR__.'/../../Fixtures/Common/libraries.csv'); |
|
50 | + $this->importCSVDataSet(__DIR__.'/../../Fixtures/Common/metadata.csv'); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
@@ -128,9 +128,9 @@ discard block |
||
128 | 128 | { |
129 | 129 | $core = $this->createSolrCore(); |
130 | 130 | |
131 | - $this->importCSVDataSet(__DIR__ . '/../../Fixtures/Common/documents_fulltext.csv'); |
|
132 | - $this->importSolrDocuments($core->solr, __DIR__ . '/../../Fixtures/Common/documents_1.solr.json'); |
|
133 | - $this->importSolrDocuments($core->solr, __DIR__ . '/../../Fixtures/Common/documents_fulltext.solr.json'); |
|
131 | + $this->importCSVDataSet(__DIR__.'/../../Fixtures/Common/documents_fulltext.csv'); |
|
132 | + $this->importSolrDocuments($core->solr, __DIR__.'/../../Fixtures/Common/documents_1.solr.json'); |
|
133 | + $this->importSolrDocuments($core->solr, __DIR__.'/../../Fixtures/Common/documents_fulltext.solr.json'); |
|
134 | 134 | |
135 | 135 | $collections = $this->collectionRepository->findCollectionsBySettings([ |
136 | 136 | 'index_name' => ['Musik', 'Projekt: Dresdner Hefte'], |
@@ -23,8 +23,7 @@ discard block |
||
23 | 23 | use TYPO3\CMS\Core\Core\Bootstrap; |
24 | 24 | use TYPO3\CMS\Core\Utility\GeneralUtility; |
25 | 25 | |
26 | -class SolrIndexingTest extends FunctionalTestCase |
|
27 | -{ |
|
26 | +class SolrIndexingTest extends FunctionalTestCase { |
|
28 | 27 | /** @var CollectionRepository */ |
29 | 28 | protected $collectionRepository; |
30 | 29 | |
@@ -53,8 +52,7 @@ discard block |
||
53 | 52 | /** |
54 | 53 | * @test |
55 | 54 | */ |
56 | - public function canCreateCore() |
|
57 | - { |
|
55 | + public function canCreateCore() { |
|
58 | 56 | $coreName = uniqid('testCore'); |
59 | 57 | $solr = Solr::getInstance($coreName); |
60 | 58 | self::assertNull($solr->core); |
@@ -69,8 +67,7 @@ discard block |
||
69 | 67 | /** |
70 | 68 | * @test |
71 | 69 | */ |
72 | - public function canIndexAndSearchDocument() |
|
73 | - { |
|
70 | + public function canIndexAndSearchDocument() { |
|
74 | 71 | $core = $this->createSolrCore(); |
75 | 72 | |
76 | 73 | $document = $this->documentRepository->findByUid(1001); |
@@ -124,8 +121,7 @@ discard block |
||
124 | 121 | /** |
125 | 122 | * @test |
126 | 123 | */ |
127 | - public function canSearchInCollections() |
|
128 | - { |
|
124 | + public function canSearchInCollections() { |
|
129 | 125 | $core = $this->createSolrCore(); |
130 | 126 | |
131 | 127 | $this->importCSVDataSet(__DIR__ . '/../../Fixtures/Common/documents_fulltext.csv'); |
@@ -165,8 +161,7 @@ discard block |
||
165 | 161 | /** |
166 | 162 | * @test |
167 | 163 | */ |
168 | - public function canGetIndexFieldName() |
|
169 | - { |
|
164 | + public function canGetIndexFieldName() { |
|
170 | 165 | $this->assertEquals('title_usi', Indexer::getIndexFieldName('title', 20000)); |
171 | 166 | $this->assertEquals('year_uuu', Indexer::getIndexFieldName('year', 20000)); |
172 | 167 | $this->assertEquals('', Indexer::getIndexFieldName('title')); |
@@ -94,11 +94,11 @@ |
||
94 | 94 | self::assertEquals(15, $solrSearch->getNumFound()); |
95 | 95 | |
96 | 96 | // Check that the title stored in Solr matches the title of database entry |
97 | - $docTitleInSolr = false; |
|
97 | + $docTitleInSolr = FALSE; |
|
98 | 98 | foreach ($solrSearch->getSolrResults()['documents'] as $solrDoc) { |
99 | 99 | if ($solrDoc['toplevel'] && intval($solrDoc['uid']) === intval($document->getUid())) { |
100 | 100 | self::assertEquals($document->getTitle(), $solrDoc['title']); |
101 | - $docTitleInSolr = true; |
|
101 | + $docTitleInSolr = TRUE; |
|
102 | 102 | break; |
103 | 103 | } |
104 | 104 | } |
@@ -23,13 +23,13 @@ |
||
23 | 23 | private $solrCoreRepository; |
24 | 24 | |
25 | 25 | private static array $databaseFixtures = [ |
26 | - __DIR__ . '/../../Fixtures/Common/documents_1.csv', |
|
27 | - __DIR__ . '/../../Fixtures/Common/pages.csv', |
|
28 | - __DIR__ . '/../../Fixtures/Common/solrcores.csv' |
|
26 | + __DIR__.'/../../Fixtures/Common/documents_1.csv', |
|
27 | + __DIR__.'/../../Fixtures/Common/pages.csv', |
|
28 | + __DIR__.'/../../Fixtures/Common/solrcores.csv' |
|
29 | 29 | ]; |
30 | 30 | |
31 | 31 | private static array $solrFixtures = [ |
32 | - __DIR__ . '/../../Fixtures/Common/documents_1.solr.json' |
|
32 | + __DIR__.'/../../Fixtures/Common/documents_1.solr.json' |
|
33 | 33 | ]; |
34 | 34 | |
35 | 35 | public function setUp(): void |
@@ -18,8 +18,7 @@ discard block |
||
18 | 18 | use Kitodo\Dlf\Domain\Repository\SolrCoreRepository; |
19 | 19 | use Kitodo\Dlf\Tests\Functional\FunctionalTestCase; |
20 | 20 | |
21 | -class SolrSearchQueryTest extends FunctionalTestCase |
|
22 | -{ |
|
21 | +class SolrSearchQueryTest extends FunctionalTestCase { |
|
23 | 22 | private $solrCoreRepository; |
24 | 23 | |
25 | 24 | private static array $databaseFixtures = [ |
@@ -43,8 +42,7 @@ discard block |
||
43 | 42 | * @test |
44 | 43 | * @ignore |
45 | 44 | */ |
46 | - public function canExecute() |
|
47 | - { |
|
45 | + public function canExecute() { |
|
48 | 46 | $documentRepository = $this->initializeRepository(DocumentRepository::class, 0); |
49 | 47 | $settings = ['solrcore' => 4, 'storagePid' => 0]; |
50 | 48 | |
@@ -68,8 +66,7 @@ discard block |
||
68 | 66 | $this->initializeRepository(DocumentRepository::class, 0); |
69 | 67 | } |
70 | 68 | |
71 | - protected function setUpSolr($uid, $storagePid, $solrFixtures) |
|
72 | - { |
|
69 | + protected function setUpSolr($uid, $storagePid, $solrFixtures) { |
|
73 | 70 | $this->solrCoreRepository = $this->initializeRepository(SolrCoreRepository::class, $storagePid); |
74 | 71 | |
75 | 72 | // Setup Solr only once for all tests in this suite |
@@ -73,9 +73,9 @@ |
||
73 | 73 | $this->solrCoreRepository = $this->initializeRepository(SolrCoreRepository::class, $storagePid); |
74 | 74 | |
75 | 75 | // Setup Solr only once for all tests in this suite |
76 | - static $solr = null; |
|
76 | + static $solr = NULL; |
|
77 | 77 | |
78 | - if ($solr === null) { |
|
78 | + if ($solr === NULL) { |
|
79 | 79 | $coreName = Solr::createCore(); |
80 | 80 | $solr = Solr::getInstance($coreName); |
81 | 81 | foreach ($solrFixtures as $filePath) { |
@@ -21,13 +21,13 @@ |
||
21 | 21 | { |
22 | 22 | |
23 | 23 | private static array $databaseFixtures = [ |
24 | - __DIR__ . '/../../Fixtures/Common/documents_1.csv', |
|
25 | - __DIR__ . '/../../Fixtures/Common/pages.csv', |
|
26 | - __DIR__ . '/../../Fixtures/Common/solrcores.csv' |
|
24 | + __DIR__.'/../../Fixtures/Common/documents_1.csv', |
|
25 | + __DIR__.'/../../Fixtures/Common/pages.csv', |
|
26 | + __DIR__.'/../../Fixtures/Common/solrcores.csv' |
|
27 | 27 | ]; |
28 | 28 | |
29 | 29 | private static array $solrFixtures = [ |
30 | - __DIR__ . '/../../Fixtures/Common/documents_1.solr.json' |
|
30 | + __DIR__.'/../../Fixtures/Common/documents_1.solr.json' |
|
31 | 31 | ]; |
32 | 32 | |
33 | 33 | /** |
@@ -17,8 +17,7 @@ discard block |
||
17 | 17 | use Kitodo\Dlf\Domain\Repository\SolrCoreRepository; |
18 | 18 | use Kitodo\Dlf\Tests\Functional\FunctionalTestCase; |
19 | 19 | |
20 | -class SolrTest extends FunctionalTestCase |
|
21 | -{ |
|
20 | +class SolrTest extends FunctionalTestCase { |
|
22 | 21 | |
23 | 22 | private static array $databaseFixtures = [ |
24 | 23 | __DIR__ . '/../../Fixtures/Common/documents_1.csv', |
@@ -33,8 +32,7 @@ discard block |
||
33 | 32 | /** |
34 | 33 | * @test |
35 | 34 | */ |
36 | - public function canCreateCore() |
|
37 | - { |
|
35 | + public function canCreateCore() { |
|
38 | 36 | $this->assertEquals('newCoreName', Solr::createCore('newCoreName')); |
39 | 37 | $this->assertEquals('newCoreName', Solr::getInstance('newCoreName')->core); |
40 | 38 | } |
@@ -42,8 +40,7 @@ discard block |
||
42 | 40 | /** |
43 | 41 | * @test |
44 | 42 | */ |
45 | - public function canEscapeQuery() |
|
46 | - { |
|
43 | + public function canEscapeQuery() { |
|
47 | 44 | $query1 = Solr::escapeQuery('"custom query with special characters: "testvalue"\n"'); |
48 | 45 | $this->assertEquals('"custom query with special characters\: "testvalue"\\\\n"', $query1); |
49 | 46 | |
@@ -54,8 +51,7 @@ discard block |
||
54 | 51 | /** |
55 | 52 | * @test |
56 | 53 | */ |
57 | - public function canEscapeQueryKeepField() |
|
58 | - { |
|
54 | + public function canEscapeQueryKeepField() { |
|
59 | 55 | $query1 = Solr::escapeQueryKeepField('abc_uui:(abc)', 0); |
60 | 56 | $this->assertEquals('abc_uui\:(abc)', $query1); |
61 | 57 | } |
@@ -63,8 +59,7 @@ discard block |
||
63 | 59 | /** |
64 | 60 | * @test |
65 | 61 | */ |
66 | - public function canGetNextCoreNumber() |
|
67 | - { |
|
62 | + public function canGetNextCoreNumber() { |
|
68 | 63 | $this->assertEquals(5, Solr::getNextCoreNumber()); |
69 | 64 | $this->assertEquals(5, Solr::getNextCoreNumber()); |
70 | 65 | Solr::createCore(); |
@@ -74,8 +69,7 @@ discard block |
||
74 | 69 | /** |
75 | 70 | * @test |
76 | 71 | */ |
77 | - public function canSearchRaw() |
|
78 | - { |
|
72 | + public function canSearchRaw() { |
|
79 | 73 | $this->setUpData(self::$databaseFixtures); |
80 | 74 | $solr = $this->setUpSolr(4, 0, self::$solrFixtures); |
81 | 75 | $resultSet = $solr->searchRaw(['core' => 4, 'collection' => 1]); |
@@ -92,8 +86,7 @@ discard block |
||
92 | 86 | $this->initializeRepository(DocumentRepository::class, 0); |
93 | 87 | } |
94 | 88 | |
95 | - protected function setUpSolr($uid, $storagePid, $solrFixtures) |
|
96 | - { |
|
89 | + protected function setUpSolr($uid, $storagePid, $solrFixtures) { |
|
97 | 90 | $solrCoreRepository = $this->initializeRepository(SolrCoreRepository::class, $storagePid); |
98 | 91 | |
99 | 92 | // Setup Solr only once for all tests in this suite |
@@ -97,9 +97,9 @@ |
||
97 | 97 | $solrCoreRepository = $this->initializeRepository(SolrCoreRepository::class, $storagePid); |
98 | 98 | |
99 | 99 | // Setup Solr only once for all tests in this suite |
100 | - static $solr = null; |
|
100 | + static $solr = NULL; |
|
101 | 101 | |
102 | - if ($solr === null) { |
|
102 | + if ($solr === NULL) { |
|
103 | 103 | $coreName = Solr::createCore(); |
104 | 104 | $solr = Solr::getInstance($coreName); |
105 | 105 | foreach ($solrFixtures as $filePath) { |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $this->configurationToUseInTestInstance['EXTENSIONS']['dlf'] = $this->getDlfConfiguration(); |
99 | 99 | |
100 | 100 | if ($this->disableJsonWrappedResponse) { |
101 | - $this->frameworkExtensionsToLoad = array_filter($this->frameworkExtensionsToLoad, function ($ext) { |
|
101 | + $this->frameworkExtensionsToLoad = array_filter($this->frameworkExtensionsToLoad, function($ext) { |
|
102 | 102 | return $ext !== 'Resources/Core/Functional/Extensions/json_response'; |
103 | 103 | }); |
104 | 104 | } |
@@ -111,9 +111,9 @@ discard block |
||
111 | 111 | $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class); |
112 | 112 | $this->persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class); |
113 | 113 | |
114 | - $this->baseUrl = 'http://web:8000/public/typo3temp/var/tests/functional-' . $this->identifier . '/'; |
|
114 | + $this->baseUrl = 'http://web:8000/public/typo3temp/var/tests/functional-'.$this->identifier.'/'; |
|
115 | 115 | $this->httpClient = new HttpClient([ |
116 | - 'base_uri' => $this->baseUrl . 'index.php', |
|
116 | + 'base_uri' => $this->baseUrl.'index.php', |
|
117 | 117 | 'http_errors' => false, |
118 | 118 | ]); |
119 | 119 | |
@@ -164,13 +164,13 @@ discard block |
||
164 | 164 | |
165 | 165 | protected function addSiteConfig($identifier) |
166 | 166 | { |
167 | - $siteConfig = Yaml::parseFile(__DIR__ . '/../Fixtures/siteconfig.yaml'); |
|
167 | + $siteConfig = Yaml::parseFile(__DIR__.'/../Fixtures/siteconfig.yaml'); |
|
168 | 168 | $siteConfig['base'] = $this->baseUrl; |
169 | 169 | $siteConfig['languages'][0]['base'] = $this->baseUrl; |
170 | 170 | |
171 | - $siteConfigPath = $this->instancePath . '/typo3conf/sites/' . $identifier; |
|
171 | + $siteConfigPath = $this->instancePath.'/typo3conf/sites/'.$identifier; |
|
172 | 172 | @mkdir($siteConfigPath, 0775, true); |
173 | - file_put_contents($siteConfigPath . '/config.yaml', Yaml::dump($siteConfig)); |
|
173 | + file_put_contents($siteConfigPath.'/config.yaml', Yaml::dump($siteConfig)); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | protected function initializeRepository(string $className, int $storagePid) |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | $jsonDocuments = json_decode(file_get_contents($path), true); |
190 | 190 | |
191 | 191 | $updateQuery = $solr->service->createUpdate(); |
192 | - $documents = array_map(function ($jsonDoc) use ($updateQuery) { |
|
192 | + $documents = array_map(function($jsonDoc) use ($updateQuery) { |
|
193 | 193 | $document = $updateQuery->createDocument(); |
194 | 194 | foreach ($jsonDoc as $key => $value) { |
195 | 195 | $document->setField($key, $value); |
@@ -91,8 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | protected $httpClient; |
93 | 93 | |
94 | - public function __construct() |
|
95 | - { |
|
94 | + public function __construct() { |
|
96 | 95 | parent::__construct(); |
97 | 96 | |
98 | 97 | $this->configurationToUseInTestInstance['EXTENSIONS']['dlf'] = $this->getDlfConfiguration(); |
@@ -120,8 +119,7 @@ discard block |
||
120 | 119 | $this->addSiteConfig('dlf-testing'); |
121 | 120 | } |
122 | 121 | |
123 | - protected function getDlfConfiguration() |
|
124 | - { |
|
122 | + protected function getDlfConfiguration() { |
|
125 | 123 | $dotenv = Dotenv::createImmutable('/home/runner/work/kitodo-presentation/kitodo-presentation/Build/Test/', 'test.env'); |
126 | 124 | $dotenv->load(); |
127 | 125 | |
@@ -162,8 +160,7 @@ discard block |
||
162 | 160 | ]; |
163 | 161 | } |
164 | 162 | |
165 | - protected function addSiteConfig($identifier) |
|
166 | - { |
|
163 | + protected function addSiteConfig($identifier) { |
|
167 | 164 | $siteConfig = Yaml::parseFile(__DIR__ . '/../Fixtures/siteconfig.yaml'); |
168 | 165 | $siteConfig['base'] = $this->baseUrl; |
169 | 166 | $siteConfig['languages'][0]['base'] = $this->baseUrl; |
@@ -173,8 +170,7 @@ discard block |
||
173 | 170 | file_put_contents($siteConfigPath . '/config.yaml', Yaml::dump($siteConfig)); |
174 | 171 | } |
175 | 172 | |
176 | - protected function initializeRepository(string $className, int $storagePid) |
|
177 | - { |
|
173 | + protected function initializeRepository(string $className, int $storagePid) { |
|
178 | 174 | $repository = $this->objectManager->get($className); |
179 | 175 | |
180 | 176 | $querySettings = $this->objectManager->get(Typo3QuerySettings::class); |
@@ -184,8 +180,7 @@ discard block |
||
184 | 180 | return $repository; |
185 | 181 | } |
186 | 182 | |
187 | - protected function importSolrDocuments(Solr $solr, string $path) |
|
188 | - { |
|
183 | + protected function importSolrDocuments(Solr $solr, string $path) { |
|
189 | 184 | $jsonDocuments = json_decode(file_get_contents($path), true); |
190 | 185 | |
191 | 186 | $updateQuery = $solr->service->createUpdate(); |
@@ -204,16 +199,14 @@ discard block |
||
204 | 199 | $solr->service->update($updateQuery); |
205 | 200 | } |
206 | 201 | |
207 | - protected function initLanguageService(string $locale) |
|
208 | - { |
|
202 | + protected function initLanguageService(string $locale) { |
|
209 | 203 | $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageServiceFactory::class)->create($locale); |
210 | 204 | } |
211 | 205 | |
212 | 206 | /** |
213 | 207 | * Assert that $sub is recursively contained within $super. |
214 | 208 | */ |
215 | - protected function assertArrayMatches(array $sub, array $super, string $message = '') |
|
216 | - { |
|
209 | + protected function assertArrayMatches(array $sub, array $super, string $message = '') { |
|
217 | 210 | self::assertEquals($sub, ArrayUtility::intersectRecursive($super, $sub), $message); |
218 | 211 | } |
219 | 212 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | ], |
50 | 50 | 'FE' => [ |
51 | 51 | 'cacheHash' => [ |
52 | - 'enforceValidation' => false, |
|
52 | + 'enforceValidation' => FALSE, |
|
53 | 53 | ], |
54 | 54 | ], |
55 | 55 | 'DB' => [ |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * |
70 | 70 | * @var bool |
71 | 71 | */ |
72 | - protected $disableJsonWrappedResponse = false; |
|
72 | + protected $disableJsonWrappedResponse = FALSE; |
|
73 | 73 | |
74 | 74 | /** |
75 | 75 | * @var ObjectManager |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $this->baseUrl = 'http://web:8000/public/typo3temp/var/tests/functional-' . $this->identifier . '/'; |
115 | 115 | $this->httpClient = new HttpClient([ |
116 | 116 | 'base_uri' => $this->baseUrl . 'index.php', |
117 | - 'http_errors' => false, |
|
117 | + 'http_errors' => FALSE, |
|
118 | 118 | ]); |
119 | 119 | |
120 | 120 | $this->addSiteConfig('dlf-testing'); |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $siteConfig['languages'][0]['base'] = $this->baseUrl; |
170 | 170 | |
171 | 171 | $siteConfigPath = $this->instancePath . '/typo3conf/sites/' . $identifier; |
172 | - @mkdir($siteConfigPath, 0775, true); |
|
172 | + @mkdir($siteConfigPath, 0775, TRUE); |
|
173 | 173 | file_put_contents($siteConfigPath . '/config.yaml', Yaml::dump($siteConfig)); |
174 | 174 | } |
175 | 175 | |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | |
187 | 187 | protected function importSolrDocuments(Solr $solr, string $path) |
188 | 188 | { |
189 | - $jsonDocuments = json_decode(file_get_contents($path), true); |
|
189 | + $jsonDocuments = json_decode(file_get_contents($path), TRUE); |
|
190 | 190 | |
191 | 191 | $updateQuery = $solr->service->createUpdate(); |
192 | 192 | $documents = array_map(function ($jsonDoc) use ($updateQuery) { |
@@ -31,8 +31,7 @@ |
||
31 | 31 | * |
32 | 32 | * @access public |
33 | 33 | */ |
34 | -class DeleteCommand extends BaseCommand |
|
35 | -{ |
|
34 | +class DeleteCommand extends BaseCommand { |
|
36 | 35 | |
37 | 36 | /** |
38 | 37 | * Configure the command by defining the name, options and arguments |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $this->initializeRepositories((int) $input->getOption('pid')); |
85 | 85 | |
86 | 86 | if ($this->storagePid == 0) { |
87 | - $io->error('ERROR: No valid PID (' . $this->storagePid . ') given.'); |
|
87 | + $io->error('ERROR: No valid PID ('.$this->storagePid.') given.'); |
|
88 | 88 | return BaseCommand::FAILURE; |
89 | 89 | } |
90 | 90 | |
@@ -99,13 +99,13 @@ discard block |
||
99 | 99 | if (empty($solrCoreUid) || !in_array($solrCoreUid, $allSolrCores)) { |
100 | 100 | $outputSolrCores = []; |
101 | 101 | foreach ($allSolrCores as $indexName => $uid) { |
102 | - $outputSolrCores[] = $uid . ' : ' . $indexName; |
|
102 | + $outputSolrCores[] = $uid.' : '.$indexName; |
|
103 | 103 | } |
104 | 104 | if (empty($outputSolrCores)) { |
105 | - $io->error('ERROR: No valid Solr core ("' . $input->getOption('solr') . '") given. No valid cores found on PID ' . $this->storagePid . ".\n"); |
|
105 | + $io->error('ERROR: No valid Solr core ("'.$input->getOption('solr').'") given. No valid cores found on PID '.$this->storagePid.".\n"); |
|
106 | 106 | return BaseCommand::FAILURE; |
107 | 107 | } else { |
108 | - $io->error('ERROR: No valid Solr core ("' . $input->getOption('solr') . '") given. ' . "Valid cores are (<uid>:<index_name>):\n" . implode("\n", $outputSolrCores) . "\n"); |
|
108 | + $io->error('ERROR: No valid Solr core ("'.$input->getOption('solr').'") given. '."Valid cores are (<uid>:<index_name>):\n".implode("\n", $outputSolrCores)."\n"); |
|
109 | 109 | return BaseCommand::FAILURE; |
110 | 110 | } |
111 | 111 | } |
@@ -147,15 +147,15 @@ discard block |
||
147 | 147 | $document = $this->getDocument($input); |
148 | 148 | |
149 | 149 | if ($document === null) { |
150 | - $io->info('INFO: Document with UID "' . $input->getOption('doc') . '" could not be found on PID ' . $this->storagePid . '. It is probably already deleted from DB.'); |
|
150 | + $io->info('INFO: Document with UID "'.$input->getOption('doc').'" could not be found on PID '.$this->storagePid.'. It is probably already deleted from DB.'); |
|
151 | 151 | } else { |
152 | 152 | if ($io->isVerbose()) { |
153 | - $io->section('Deleting ' . $document->getUid() . ' ("' . $document->getLocation() . '") on PID ' . $this->storagePid . '.'); |
|
153 | + $io->section('Deleting '.$document->getUid().' ("'.$document->getLocation().'") on PID '.$this->storagePid.'.'); |
|
154 | 154 | } |
155 | 155 | $this->documentRepository->remove($document); |
156 | 156 | $this->persistenceManager->persistAll(); |
157 | 157 | if ($io->isVerbose()) { |
158 | - $io->success('Deleted ' . $document->getUid() . ' ("' . $document->getLocation() . '") on PID ' . $this->storagePid . '.'); |
|
158 | + $io->success('Deleted '.$document->getUid().' ("'.$document->getLocation().'") on PID '.$this->storagePid.'.'); |
|
159 | 159 | } |
160 | 160 | } |
161 | 161 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | private function deleteFromSolr($input, $io, $solrCoreUid): void |
175 | 175 | { |
176 | 176 | if ($io->isVerbose()) { |
177 | - $io->section('Deleting ' . $input->getOption('doc') . ' on Solr core ' . $solrCoreUid . '.'); |
|
177 | + $io->section('Deleting '.$input->getOption('doc').' on Solr core '.$solrCoreUid.'.'); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | $isDeleted = false; |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | |
188 | 188 | if ($isDeleted) { |
189 | 189 | if ($io->isVerbose()) { |
190 | - $io->success('Deleted ' . $input->getOption('doc') . ' on Solr core ' . $solrCoreUid . '.'); |
|
190 | + $io->success('Deleted '.$input->getOption('doc').' on Solr core '.$solrCoreUid.'.'); |
|
191 | 191 | } |
192 | 192 | $io->success('All done!'); |
193 | 193 | } else { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | ) |
67 | 67 | ->addOption( |
68 | 68 | 'softCommit', |
69 | - null, |
|
69 | + NULL, |
|
70 | 70 | InputOption::VALUE_NONE, |
71 | 71 | 'If this option is set, documents are just deleted from the index by a soft commit.' |
72 | 72 | ); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | { |
153 | 153 | $document = $this->getDocument($input); |
154 | 154 | |
155 | - if ($document === null) { |
|
155 | + if ($document === NULL) { |
|
156 | 156 | $io->info('INFO: Document with UID "' . $input->getOption('doc') . '" could not be found on PID ' . $this->storagePid . '. It is probably already deleted from DB.'); |
157 | 157 | } else { |
158 | 158 | if ($io->isVerbose()) { |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $io->section('Deleting ' . $input->getOption('doc') . ' on Solr core ' . $solrCoreUid . '.'); |
184 | 184 | } |
185 | 185 | |
186 | - $isDeleted = false; |
|
186 | + $isDeleted = FALSE; |
|
187 | 187 | if (MathUtility::canBeInterpretedAsInteger($input->getOption('doc'))) { |
188 | 188 | $isDeleted = Indexer::delete($input, 'uid', $solrCoreUid, $input->getOption('softCommit')); |
189 | 189 | |
@@ -212,12 +212,12 @@ discard block |
||
212 | 212 | */ |
213 | 213 | private function getDocument($input): ?Document |
214 | 214 | { |
215 | - $document = null; |
|
215 | + $document = NULL; |
|
216 | 216 | |
217 | 217 | if (MathUtility::canBeInterpretedAsInteger($input->getOption('doc'))) { |
218 | 218 | $document = $this->documentRepository->findByUid($input->getOption('doc')); |
219 | 219 | } elseif (GeneralUtility::isValidUrl($input->getOption('doc'))) { |
220 | - $doc = AbstractDocument::getInstance($input->getOption('doc'), ['storagePid' => $this->storagePid], true); |
|
220 | + $doc = AbstractDocument::getInstance($input->getOption('doc'), ['storagePid' => $this->storagePid], TRUE); |
|
221 | 221 | |
222 | 222 | if ($doc->recordId) { |
223 | 223 | $document = $this->documentRepository->findOneByRecordId($doc->recordId); |