Passed
Pull Request — master (#123)
by
unknown
11:14
created
Tests/Functional/Repository/MetatdataRepositoryTest.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,8 +16,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -67,14 +67,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
Tests/Functional/Api/PageViewProxyTest.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
         ]);
87 87
 
88 88
         self::assertEquals(200, $response->getStatusCode());
89
-        self::assertEquals('This is some plain text test file.' . "\n", (string) $response->getBody());
89
+        self::assertEquals('This is some plain text test file.'."\n", (string) $response->getBody());
90 90
     }
91 91
 
92 92
     /**
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,12 +15,10 @@  discard block
 block discarded – undo
15 15
 use Kitodo\Dlf\Tests\Functional\FunctionalTestCase;
16 16
 use TYPO3\CMS\Core\Utility\GeneralUtility;
17 17
 
18
-class PageViewProxyTest extends FunctionalTestCase
19
-{
18
+class PageViewProxyTest extends FunctionalTestCase {
20 19
     protected $disableJsonWrappedResponse = true;
21 20
 
22
-    protected function getDlfConfiguration()
23
-    {
21
+    protected function getDlfConfiguration() {
24 22
         return array_merge(parent::getDlfConfiguration(), [
25 23
             'general' => [
26 24
                 'enableInternalProxy' => true
@@ -28,8 +26,7 @@  discard block
 block discarded – undo
28 26
         ]);
29 27
     }
30 28
 
31
-    protected function queryProxy(array $query, string $method = 'GET')
32
-    {
29
+    protected function queryProxy(array $query, string $method = 'GET') {
33 30
         $query['eID'] = 'tx_dlf_pageview_proxy';
34 31
 
35 32
         return $this->httpClient->request($method, '', [
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,13 +17,13 @@
 block discarded – undo
17 17
 
18 18
 class PageViewProxyTest extends FunctionalTestCase
19 19
 {
20
-    protected $disableJsonWrappedResponse = true;
20
+    protected $disableJsonWrappedResponse = TRUE;
21 21
 
22 22
     protected function getDlfConfiguration()
23 23
     {
24 24
         return array_merge(parent::getDlfConfiguration(), [
25 25
             'general' => [
26
-                'enableInternalProxy' => true
26
+                'enableInternalProxy' => TRUE
27 27
             ]
28 28
         ]);
29 29
     }
Please login to merge, or discard this patch.
Tests/Functional/ViewHelpers/JsFooterViewHelperTest.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,8 +20,7 @@
 block discarded – undo
20 20
 /**
21 21
  * @covers JsFooterViewHelper
22 22
  */
23
-class JsFooterViewHelperTest extends FunctionalTestCase
24
-{
23
+class JsFooterViewHelperTest extends FunctionalTestCase {
25 24
     /**
26 25
      * @var bool Speed up this test case, it needs no database
27 26
      */
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
Tests/Functional/ViewHelpers/MetadataWrapVariableViewHelperTest.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
 
35 35
         $view->assign(
36 36
             'configObject',
37
-            [ 'wrap' => 'all.wrap = <article class="shlb-metadata-text-item metadata-title">|</article>
37
+            ['wrap' => 'all.wrap = <article class="shlb-metadata-text-item metadata-title">|</article>
38 38
                  key.wrap = <label>|</label>
39 39
                  value.required = 1
40 40
                  value.wrap = <li>|</li>'
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,8 +18,7 @@
 block discarded – undo
18 18
 /**
19 19
  * @covers MetadataWrapVariableViewHelper
20 20
  */
21
-class MetadataWrapVariableViewHelperTest extends FunctionalTestCase
22
-{
21
+class MetadataWrapVariableViewHelperTest extends FunctionalTestCase {
23 22
     /**
24 23
      * @var bool Speed up this test case, it needs no database
25 24
      */
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
Tests/Functional/ViewHelpers/StdWrapViewHelperTest.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,8 +18,7 @@
 block discarded – undo
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
      */
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
Tests/Functional/Common/HelperTest.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -15,8 +15,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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');
Please login to merge, or discard this patch.
Tests/Functional/Common/IiifUrlReaderTest.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,14 +15,12 @@
 block discarded – undo
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';
Please login to merge, or discard this patch.
Tests/Functional/Common/SolrSearchTest.php 3 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,11 +21,11 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -18,8 +18,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
Upper-Lower-Casing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -51,21 +51,21 @@  discard block
 block discarded – undo
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
 block discarded – undo
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) {
Please login to merge, or discard this patch.
Tests/Functional/Common/SolrIndexingTest.php 3 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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'],
Please login to merge, or discard this patch.
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -23,8 +23,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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'));
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -94,11 +94,11 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.