Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6516e85

Browse files
committedSep 8, 2016
[FEATURE] Split the sys_domain tests from the rest to display more errors at once
1 parent 05cc057 commit 6516e85

File tree

7 files changed

+164
-24
lines changed

7 files changed

+164
-24
lines changed
 

‎Classes/Testing/Tests/Application/ForeignInstanceTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
use In2code\In2publishCore\Testing\Tests\TestCaseInterface;
3131
use In2code\In2publishCore\Testing\Tests\TestResult;
3232
use In2code\In2publishCore\Utility\ConfigurationUtility;
33-
use In2code\In2publishCore\Utility\DatabaseUtility;
3433
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
3534
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
3635

@@ -45,11 +44,6 @@ class ForeignInstanceTest implements TestCaseInterface
4544
public function run()
4645
{
4746
$sshConnection = SshConnection::makeInstance();
48-
$foreignDatabase = DatabaseUtility::buildForeignDatabaseConnection();
49-
50-
if ($foreignDatabase->exec_SELECTcountRows('*', 'sys_domain', 'hidden=0') === 0) {
51-
return new TestResult('application.foreign_sys_domain_missing', TestResult::ERROR);
52-
}
5347
$dispatcherResult = $sshConnection->callForeignCliDispatcherCallable();
5448

5549
if (false !== strpos($dispatcherResult['stdOut'], '_cli_lowlevel')) {
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
namespace In2code\In2publishCore\Testing\Tests\Application;
3+
4+
/***************************************************************
5+
* Copyright notice
6+
*
7+
* (c) 2016 in2code.de and the following authors:
8+
* Oliver Eglseder <oliver.eglseder@in2code.de>
9+
*
10+
* All rights reserved
11+
*
12+
* This script is part of the TYPO3 project. The TYPO3 project is
13+
* free software; you can redistribute it and/or modify
14+
* it under the terms of the GNU General Public License as published by
15+
* the Free Software Foundation; either version 3 of the License, or
16+
* (at your option) any later version.
17+
*
18+
* The GNU General Public License can be found at
19+
* http://www.gnu.org/copyleft/gpl.html.
20+
*
21+
* This script is distributed in the hope that it will be useful,
22+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
23+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24+
* GNU General Public License for more details.
25+
*
26+
* This copyright notice MUST APPEAR in all copies of the script!
27+
***************************************************************/
28+
29+
use In2code\In2publishCore\Testing\Tests\TestCaseInterface;
30+
use In2code\In2publishCore\Testing\Tests\TestResult;
31+
use In2code\In2publishCore\Utility\DatabaseUtility;
32+
33+
/**
34+
* Class ForeignSysDomainTest
35+
*/
36+
class ForeignSysDomainTest implements TestCaseInterface
37+
{
38+
/**
39+
* @return TestResult
40+
*/
41+
public function run()
42+
{
43+
$foreignDatabase = DatabaseUtility::buildForeignDatabaseConnection();
44+
45+
if ($foreignDatabase->exec_SELECTcountRows('*', 'sys_domain', 'hidden=0') === 0) {
46+
return new TestResult('application.foreign_sys_domain_missing', TestResult::ERROR);
47+
}
48+
return new TestResult('application.foreign_sys_domain_configured');
49+
}
50+
51+
/**
52+
* @return array
53+
*/
54+
public function getDependencies()
55+
{
56+
return array(
57+
'In2code\\In2publishCore\\Testing\\Tests\\SshConnection\\SshConnectionTest',
58+
);
59+
}
60+
}

‎Classes/Testing/Tests/Application/LocalInstanceTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ public function run()
4444
{
4545
$localDatabase = DatabaseUtility::buildLocalDatabaseConnection();
4646

47-
if ($localDatabase->exec_SELECTcountRows('*', 'sys_domain', 'hidden=0') === 0) {
48-
return new TestResult('application.local_sys_domain_missing', TestResult::ERROR);
49-
}
50-
5147
if (!empty($GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem'])) {
5248
return new TestResult('application.local_utf8_fs', TestResult::ERROR, array('application.utf8_fs_errors'));
5349
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
namespace In2code\In2publishCore\Testing\Tests\Application;
3+
4+
/***************************************************************
5+
* Copyright notice
6+
*
7+
* (c) 2016 in2code.de and the following authors:
8+
* Oliver Eglseder <oliver.eglseder@in2code.de>
9+
*
10+
* All rights reserved
11+
*
12+
* This script is part of the TYPO3 project. The TYPO3 project is
13+
* free software; you can redistribute it and/or modify
14+
* it under the terms of the GNU General Public License as published by
15+
* the Free Software Foundation; either version 3 of the License, or
16+
* (at your option) any later version.
17+
*
18+
* The GNU General Public License can be found at
19+
* http://www.gnu.org/copyleft/gpl.html.
20+
*
21+
* This script is distributed in the hope that it will be useful,
22+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
23+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24+
* GNU General Public License for more details.
25+
*
26+
* This copyright notice MUST APPEAR in all copies of the script!
27+
***************************************************************/
28+
29+
use In2code\In2publishCore\Testing\Tests\TestCaseInterface;
30+
use In2code\In2publishCore\Testing\Tests\TestResult;
31+
use In2code\In2publishCore\Utility\DatabaseUtility;
32+
33+
/**
34+
* Class LocalSysDomainTest
35+
*/
36+
class LocalSysDomainTest implements TestCaseInterface
37+
{
38+
/**
39+
* @return TestResult
40+
*/
41+
public function run()
42+
{
43+
$localDatabase = DatabaseUtility::buildLocalDatabaseConnection();
44+
45+
if ($localDatabase->exec_SELECTcountRows('*', 'sys_domain', 'hidden=0') === 0) {
46+
return new TestResult('application.local_sys_domain_missing', TestResult::ERROR);
47+
}
48+
return new TestResult('application.local_sys_domain_configured');
49+
}
50+
51+
/**
52+
* @return array
53+
*/
54+
public function getDependencies()
55+
{
56+
return array(
57+
'In2code\\In2publishCore\\Testing\\Tests\\Database\\LocalDatabaseTest'
58+
);
59+
}
60+
}

‎Resources/Private/Language/de.locallang.testing.xlf

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,6 @@
261261
<source>The local environment was validated successfully.</source>
262262
<target state="translated">Die lokale Instanz wurde erfolgreich validiert.</target>
263263
</trans-unit>
264-
<trans-unit id="application.local_sys_domain_missing">
265-
<source>No valid sys_domain entry has been be found on the local system.</source>
266-
<target state="translated">Es wurde kein gültiger sys_domain Eintrag im lokalen System gefunden.</target>
267-
</trans-unit>
268264
<trans-unit id="application.local_utf8_fs">
269265
<source>UTF8 filesystem configured for the local system, please disable this configuration in Install tool.</source>
270266
<target state="translated">Lokal ist UTF8 Dateisystem konfiguriert. Bitte deaktivieren sie diese Option im Install Tool.</target>
@@ -278,16 +274,23 @@
278274
<target state="translated">Folgende Tabellen wurden konfiguriert, existieren aber nicht:</target>
279275
</trans-unit>
280276

277+
<!-- \In2code\In2publishCore\Testing\Tests\Application\LocalSysDomainTest -->
278+
279+
<trans-unit id="application.local_sys_domain_missing">
280+
<source>No valid sys_domain entry has been on the local system.</source>
281+
<target state="translated">Es wurde kein gültiger sys_domain Eintrag im lokalen System gefunden.</target>
282+
</trans-unit>
283+
<trans-unit id="application.local_sys_domain_configured">
284+
<source>A valid sys_domain entry has been found on the local system.</source>
285+
<target state="translated">Es wurde ein gültiger sys_domain Eintrag im lokalen System gefunden.</target>
286+
</trans-unit>
287+
281288
<!-- \In2code\In2publishCore\Testing\Tests\Application\ForeignInstanceTest -->
282289

283290
<trans-unit id="application.foreign_system_validated">
284291
<source>The foreign environment was validated successfully.</source>
285292
<target state="translated">Die entfernte Instanz wurde erfolgreich validiert.</target>
286293
</trans-unit>
287-
<trans-unit id="application.foreign_sys_domain_missing">
288-
<source>No valid sys_domain entry has been be found on the foreign system.</source>
289-
<target state="translated">Es wurde kein gültiger sys_domain Eintrag im entfernte System gefunden.</target>
290-
</trans-unit>
291294
<trans-unit id="application.foreign_cli_lowlevel_user_missing">
292295
<source>Could not call the CLI dispatcher on foreign because the backend user "_cli_lowlevel" is missing there.</source>
293296
<target state="translated">Der CLI dispatcher konnte auf dem entfernten System nicht aufgerufen werden, da dort der Backend User "_cli_lowlevel" fehlt.</target>
@@ -340,6 +343,17 @@
340343
<source>Foreign TYPO3 Version:</source>
341344
<target state="translated">Entfernte TYPO3 Version:</target>
342345
</trans-unit>
346+
347+
<!-- \In2code\In2publishCore\Testing\Tests\Application\ForeignSysDomainTest -->
348+
349+
<trans-unit id="application.foreign_sys_domain_missing">
350+
<source>No valid sys_domain entry has been found on the foreign system.</source>
351+
<target state="translated">Es wurde kein gültiger sys_domain Eintrag im entfernte System gefunden.</target>
352+
</trans-unit>
353+
<trans-unit id="application.foreign_sys_domain_present">
354+
<source>A valid sys_domain entry has been found on the foreign system.</source>
355+
<target state="translated">Es wurde ein gültiger sys_domain Eintrag im entfernte System gefunden.</target>
356+
</trans-unit>
343357
</body>
344358
</file>
345359
</xliff>

‎Resources/Private/Language/locallang.testing.xlf

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,6 @@
209209
<trans-unit id="application.local_instance_validated">
210210
<source>The local environment was validated successfully.</source>
211211
</trans-unit>
212-
<trans-unit id="application.local_sys_domain_missing">
213-
<source>No valid sys_domain entry has been be found on the local system.</source>
214-
</trans-unit>
215212
<trans-unit id="application.local_utf8_fs">
216213
<source>UTF8 filesystem configured for the local system, please disable this configuration in Install tool.</source>
217214
</trans-unit>
@@ -222,14 +219,22 @@
222219
<source>Following tables are configured but do not exist:</source>
223220
</trans-unit>
224221

222+
<!-- \In2code\In2publishCore\Testing\Tests\Application\LocalSysDomainTest -->
223+
224+
<trans-unit id="application.local_sys_domain_missing">
225+
<source>No valid sys_domain entry has been on the local system.</source>
226+
<target state="translated">Es wurde kein gültiger sys_domain Eintrag im lokalen System gefunden.</target>
227+
</trans-unit>
228+
<trans-unit id="application.local_sys_domain_configured">
229+
<source>A valid sys_domain entry has been found on the local system.</source>
230+
<target state="translated">Es wurde ein gültiger sys_domain Eintrag im lokalen System gefunden.</target>
231+
</trans-unit>
232+
225233
<!-- \In2code\In2publishCore\Testing\Tests\Application\ForeignInstanceTest -->
226234

227235
<trans-unit id="application.foreign_system_validated">
228236
<source>The foreign environment was validated successfully.</source>
229237
</trans-unit>
230-
<trans-unit id="application.foreign_sys_domain_missing">
231-
<source>No valid sys_domain entry has been be found on the foreign system.</source>
232-
</trans-unit>
233238
<trans-unit id="application.foreign_cli_lowlevel_user_missing">
234239
<source>Could not call the CLI dispatcher on foreign because the backend user "_cli_lowlevel" is missing there.</source>
235240
</trans-unit>
@@ -269,6 +274,15 @@
269274
<trans-unit id="application.foreign_t3_versions">
270275
<source>Foreign TYPO3 Version:</source>
271276
</trans-unit>
277+
278+
<!-- \In2code\In2publishCore\Testing\Tests\Application\ForeignSysDomainTest -->
279+
280+
<trans-unit id="application.foreign_sys_domain_missing">
281+
<source>No valid sys_domain entry has been found on the foreign system.</source>
282+
</trans-unit>
283+
<trans-unit id="application.foreign_sys_domain_present">
284+
<source>A valid sys_domain entry has been found on the foreign system.</source>
285+
</trans-unit>
272286
</body>
273287
</file>
274288
</xliff>

‎ext_tables.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ function ($extKey) {
184184
'In2code\\In2publishCore\\Testing\\Tests\\SshConnection\\SshFunctionAvailabilityTest',
185185
'In2code\\In2publishCore\\Testing\\Tests\\SshConnection\\SshConnectionTest',
186186
'In2code\\In2publishCore\\Testing\\Tests\\Application\\LocalInstanceTest',
187+
'In2code\\In2publishCore\\Testing\\Tests\\Application\\LocalSysDomainTest',
187188
'In2code\\In2publishCore\\Testing\\Tests\\Application\\ForeignInstanceTest',
189+
'In2code\\In2publishCore\\Testing\\Tests\\Application\\ForeignSysDomainTest',
188190
);
189191
}
190192
}

0 commit comments

Comments
 (0)