mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
Merge remote-tracking branch 'origin/support/3.0' into support/3.1
Most of the conflicts are caused by HU translations (N°7077 / #584) # Conflicts: # css/setup.css # datamodels/2.x/authent-cas/dictionaries/hu.dict.authent-cas.php # datamodels/2.x/authent-ldap/dictionaries/hu.dict.authent-ldap.php # datamodels/2.x/authent-local/dictionaries/hu.dict.authent-local.php # datamodels/2.x/combodo-backoffice-darkmoon-theme/dictionaries/hu.dict.combodo-backoffice-darkmoon-theme.php # datamodels/2.x/combodo-db-tools/dictionaries/hu.dict.combodo-db-tools.php # datamodels/2.x/itop-attachments/dictionaries/hu.dict.itop-attachments.php # datamodels/2.x/itop-backup/dictionaries/hu.dict.itop-backup.php # datamodels/2.x/itop-bridge-cmdb-ticket/dictionaries/hu.dict.itop-bridge-cmdb-ticket.php # datamodels/2.x/itop-change-mgmt-itil/dictionaries/hu.dict.itop-change-mgmt-itil.php # datamodels/2.x/itop-change-mgmt/dictionaries/hu.dict.itop-change-mgmt.php # datamodels/2.x/itop-config-mgmt/dictionaries/hu.dict.itop-config-mgmt.php # datamodels/2.x/itop-config/dictionaries/hu.dict.itop-config.php # datamodels/2.x/itop-core-update/dictionaries/hu.dict.itop-core-update.php # datamodels/2.x/itop-faq-light/dictionaries/hu.dict.itop-faq-light.php # datamodels/2.x/itop-hub-connector/dictionaries/hu.dict.itop-hub-connector.php # datamodels/2.x/itop-incident-mgmt-itil/dictionaries/hu.dict.itop-incident-mgmt-itil.php # datamodels/2.x/itop-knownerror-mgmt/dictionaries/hu.dict.itop-knownerror-mgmt.php # datamodels/2.x/itop-oauth-client/hu.dict.itop-oauth-client.php # datamodels/2.x/itop-portal-base/dictionaries/hu.dict.itop-portal-base.php # datamodels/2.x/itop-portal/dictionaries/hu.dict.itop-portal.php # datamodels/2.x/itop-problem-mgmt/dictionaries/hu.dict.itop-problem-mgmt.php # datamodels/2.x/itop-request-mgmt-itil/dictionaries/hu.dict.itop-request-mgmt-itil.php # datamodels/2.x/itop-request-mgmt/dictionaries/hu.dict.itop-request-mgmt.php # datamodels/2.x/itop-service-mgmt-provider/dictionaries/hu.dict.itop-service-mgmt-provider.php # datamodels/2.x/itop-service-mgmt/dictionaries/hu.dict.itop-service-mgmt.php # datamodels/2.x/itop-structure/dictionaries/hu.dict.itop-structure.php # datamodels/2.x/itop-tickets/dictionaries/hu.dict.itop-tickets.php # dictionaries/hu.dictionary.itop.core.php # dictionaries/hu.dictionary.itop.ui.php # dictionaries/ui/components/breadcrumbs/hu.dictionary.itop.breadcrumbs.php # dictionaries/ui/components/datatable/hu.dictionary.itop.datatable.php # dictionaries/ui/components/field/hu.dictionary.itop.field.php # dictionaries/ui/components/global-search/hu.dictionary.itop.global-search.php # dictionaries/ui/components/input/hu.dictionary.itop.input.php # dictionaries/ui/components/quick-create/hu.dictionary.itop.quick-create.php # dictionaries/ui/layouts/activity-panel/hu.dictionary.itop.activity-panel.php # dictionaries/ui/layouts/navigation-menu/hu.dictionary.itop.navigation-menu.php # dictionaries/ui/layouts/object-details/hu.dictionary.itop.object-details.php # dictionaries/ui/layouts/page-content/hu.dictionary.itop.page-content.php # dictionaries/ui/layouts/tab-container/hu.dictionary.itop.tab-container.php # dictionaries/ui/pages/errorpage/hu.dictionary.itop.errorpage.php # dictionaries/ui/pages/preferences/hu.dictionary.itop.preferences.php # tests/php-unit-tests/unitary-tests/setup/DBBackupTest.php
This commit is contained in:
@@ -23,19 +23,31 @@ namespace Combodo\iTop\Test\UnitTest\ReleaseChecklist;
|
||||
|
||||
use Combodo\iTop\Test\UnitTest\ItopTestCase;
|
||||
use iTopDesignFormat;
|
||||
use utils;
|
||||
|
||||
|
||||
/**
|
||||
* Class iTopDesignFormatChecklistTest
|
||||
*
|
||||
* @covers iTopDesignFormat
|
||||
* Class SetupCssIntegrityChecklistTest
|
||||
*/
|
||||
class SetupCssIntegrityChecklistTest extends ItopTestCase
|
||||
{
|
||||
public function testSetupCssIntegrity()
|
||||
{
|
||||
$sSetupCssPath = APPROOT.'css/setup.css';
|
||||
$sSetupCssContent = file_get_contents($sSetupCssPath);
|
||||
$this->assertGreaterThan(4000, strlen($sSetupCssContent), "Test if the resulting file $sSetupCssPath is long enough, the value is totally arbitrary (at the time of the writing the file is 5660o long");
|
||||
$sCssFileAbsPath = APPROOT."css/setup.css";
|
||||
|
||||
// First check if the compiled file exists
|
||||
$this->assertTrue(file_exists($sCssFileAbsPath));
|
||||
|
||||
// Then check that it is not empty
|
||||
$sVersionedCssFileContent = file_get_contents($sCssFileAbsPath);
|
||||
$this->assertGreaterThan(0, strlen($sVersionedCssFileContent), "Compiled setup.css file seems empty");
|
||||
|
||||
// Then check that the compiled file is up-to-date
|
||||
$sScssFileRelPath = "css/setup.scss";
|
||||
$sScssFileAbsPath = APPROOT . $sScssFileRelPath;
|
||||
touch($sScssFileAbsPath);
|
||||
utils::GetCSSFromSASS($sScssFileRelPath);
|
||||
$sCompiledCssFileContent = file_get_contents($sCssFileAbsPath);
|
||||
$this->assertSame($sCompiledCssFileContent, $sVersionedCssFileContent, "Compiled setup.css file does not seem up to date as the one compiled just now is different");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,6 +145,39 @@ class CMDBSourceTest extends ItopTestCase
|
||||
$this->assertFalse($bIsTlsCnx);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider InitServerAndPortProvider
|
||||
* @since 2.7.10 3.0.4 3.1.2 3.2.0 N°6889 method creation to keep track of the behavior change (port will return null)
|
||||
*/
|
||||
public function testInitServerAndPort(string $sDbHost, string $sExpectedServer, ?int $iExpectedPort)
|
||||
{
|
||||
$sActualServer = null;
|
||||
$iActualPort = null;
|
||||
CMDBSource::InitServerAndPort($sDbHost, $sActualServer, $iActualPort);
|
||||
|
||||
$this->assertNotNull($sActualServer);
|
||||
$this->assertEquals($sExpectedServer, $sActualServer);
|
||||
$this->assertEquals($iExpectedPort, $iActualPort);
|
||||
}
|
||||
|
||||
public function InitServerAndPortProvider()
|
||||
{
|
||||
return [
|
||||
'localhost no port' => ['localhost', 'localhost', null],
|
||||
'localhost with port' => ['localhost:333306', 'localhost', 333306],
|
||||
'persistent localhost no port' => ['p:localhost', 'p:localhost', null],
|
||||
'persistent localhost with port' => ['p:localhost:333306', 'p:localhost', 333306],
|
||||
'ip no port' => ['192.168.1.10', '192.168.1.10', null],
|
||||
'ip with port' => ['192.168.1.10:333306', '192.168.1.10', 333306],
|
||||
'persistent ip no port' => ['p:192.168.1.10', 'p:192.168.1.10', null],
|
||||
'persistent ip with port' => ['p:192.168.1.10:333306', 'p:192.168.1.10', 333306],
|
||||
'domain no port' => ['dbserver.mycompany.com', 'dbserver.mycompany.com', null],
|
||||
'domain with port' => ['dbserver.mycompany.com:333306', 'dbserver.mycompany.com', 333306],
|
||||
'persistent domain no port' => ['p:dbserver.mycompany.com', 'p:dbserver.mycompany.com', null],
|
||||
'persistent domain with port' => ['p:dbserver.mycompany.com:333306', 'p:dbserver.mycompany.com', 333306],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.7.10 3.0.4 3.1.1 3.2.0 N°6643 Checks writing in IssueLog is really done
|
||||
*/
|
||||
|
||||
@@ -104,30 +104,44 @@ class DBBackupTest extends ItopTestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* Host is localhost, we should be forced into tcp
|
||||
*
|
||||
* @return void
|
||||
* @dataProvider GetMysqlCliPortAndTransportOptionsProvider
|
||||
* @since 2.7.10 3.0.4 3.1.2 3.2.0 test for N°6123 and N°6889
|
||||
*/
|
||||
public function testGetMysqlCliTransportOptionWithLocalhost()
|
||||
public function testGetMysqlCliPortAndTransportOptions(string $sDbHost, ?int $iPort, ?int $iExpectedPortValue, string $sExpectedProtocolCliOption)
|
||||
{
|
||||
$sHost= 'localhost';
|
||||
$sTransport = DBBackup::GetMysqlCliTransportOption($sHost);
|
||||
if (is_null($iExpectedPortValue)) {
|
||||
$sExpectedPortCliOption = '';
|
||||
} else {
|
||||
$sEscapedPortValue = \DBBackup::EscapeShellArg($iExpectedPortValue);
|
||||
$sExpectedPortCliOption = ' --port=' . $sEscapedPortValue;
|
||||
}
|
||||
|
||||
$this->assertStringStartsWith('--protocol=tcp', $sTransport);
|
||||
$this->assertStringEndsWith('--protocol=tcp', $sTransport);
|
||||
$sActualCliOptions = $this->InvokeNonPublicStaticMethod(DBBackup::class, 'GetMysqlCliPortAndTransportOptions', [$sDbHost, $iPort]);
|
||||
$this->assertEquals($sExpectedPortCliOption . $sExpectedProtocolCliOption, $sActualCliOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
* Host is not localhost, we shouldn't be forced into tcp
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testGetMysqlCliTransportOptionWithoutLocalhost()
|
||||
public function GetMysqlCliPortAndTransportOptionsProvider()
|
||||
{
|
||||
$sHost= '127.0.0.1';
|
||||
$sTransport = DBBackup::GetMysqlCliTransportOption($sHost);
|
||||
$iTestPort = 333306;
|
||||
$iDefaultPort = 3306; // cannot access \CMDBSource::MYSQL_DEFAULT_PORT in dataprovider :(
|
||||
|
||||
$this->assertEmpty($sTransport);
|
||||
return [
|
||||
'Localhost no port' => ['localhost', null, null, ''],
|
||||
'Localhost with port' => ['localhost', $iTestPort, $iTestPort, ' --protocol=tcp'],
|
||||
|
||||
// we want both port and protocol for 127.0.0.1, because it is an ip address so using tcp/ip stack !
|
||||
'127.0.0.1 no port' => ['127.0.0.1', null, $iDefaultPort, ''],
|
||||
'127.0.0.1 with port' => ['127.0.0.1', $iTestPort, $iTestPort, ''],
|
||||
|
||||
'IP no port' => ['192.168.1.15', null, $iDefaultPort, ''],
|
||||
'IP with port' => ['192.168.1.15', $iTestPort, $iTestPort, ''],
|
||||
|
||||
'DNS no port' => ['dbserver.mycompany.com', null, $iDefaultPort, ''],
|
||||
'DNS with port' => ['dbserver.mycompany.com', $iTestPort, $iTestPort, ''],
|
||||
|
||||
'Windows name no port' => ['dbserver', null, $iDefaultPort, ''],
|
||||
'Windows name with port' => ['dbserver', $iTestPort, $iTestPort, ''],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user