Prevent PHP notice on unitialized variables.
These variables are expected to be uninitialized when the forced install process is not used.
This commit is contained in:
parent
8cc8a3f064
commit
2c000c20da
@ -151,7 +151,7 @@ if (! empty($force_install_message))
|
|||||||
<td valign="top" class="label"><b> <?php print $langs->trans("DocumentsDirectory"); ?></b>
|
<td valign="top" class="label"><b> <?php print $langs->trans("DocumentsDirectory"); ?></b>
|
||||||
</td>
|
</td>
|
||||||
<?php
|
<?php
|
||||||
$dolibarr_main_data_root = $force_install_main_data_root;
|
$dolibarr_main_data_root = @$force_install_main_data_root;
|
||||||
if (empty($dolibarr_main_data_root)) {
|
if (empty($dolibarr_main_data_root)) {
|
||||||
$dolibarr_main_data_root = detect_dolibarr_main_data_root($dolibarr_main_document_root);
|
$dolibarr_main_data_root = detect_dolibarr_main_data_root($dolibarr_main_document_root);
|
||||||
}
|
}
|
||||||
@ -478,7 +478,7 @@ if (! empty($force_install_message))
|
|||||||
id="db_user_root"
|
id="db_user_root"
|
||||||
name="db_user_root"
|
name="db_user_root"
|
||||||
class="needroot"
|
class="needroot"
|
||||||
value="<?php print (!empty($force_install_databaserootlogin)) ? $force_install_databaserootlogin : $db_user_root; ?>"
|
value="<?php print (!empty($force_install_databaserootlogin)) ? $force_install_databaserootlogin : @$db_user_root; ?>"
|
||||||
<?php if ($force_install_noedit == 2 && $force_install_databaserootlogin !== null) {
|
<?php if ($force_install_noedit == 2 && $force_install_databaserootlogin !== null) {
|
||||||
print 'disabled';
|
print 'disabled';
|
||||||
} ?>
|
} ?>
|
||||||
@ -506,7 +506,7 @@ if (! empty($force_install_message))
|
|||||||
class="needroot"
|
class="needroot"
|
||||||
value="<?php
|
value="<?php
|
||||||
// We don't want to set password. It will be extracted from the forced install file at step1.
|
// We don't want to set password. It will be extracted from the forced install file at step1.
|
||||||
$autofill = ((!empty($force_install_database_rootpass)) ? '' : $db_pass_root);
|
$autofill = ((!empty($force_install_database_rootpass)) ? '' : @$db_pass_root);
|
||||||
if (!empty($dolibarr_main_prod)) {
|
if (!empty($dolibarr_main_prod)) {
|
||||||
$autofill = '';
|
$autofill = '';
|
||||||
} // Do not autofill password if instance is a production instance
|
} // Do not autofill password if instance is a production instance
|
||||||
|
|||||||
@ -79,7 +79,7 @@ $db=getDoliDBInstance($conf->db->type,$conf->db->host,$conf->db->user,$conf->db-
|
|||||||
if ($db->ok)
|
if ($db->ok)
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans("DolibarrAdminLogin").' :</td><td>';
|
print '<tr><td>'.$langs->trans("DolibarrAdminLogin").' :</td><td>';
|
||||||
print '<input name="login" type="text" value="' . (!empty($_GET["login"]) ? $_GET["login"] : (isset($force_install_dolibarrlogin) ? $force_install_dolibarrlogin : '')) . '"' . ($force_install_noedit == 2 && $force_install_dolibarrlogin !== null ? ' disabled' : '') . '></td></tr>';
|
print '<input name="login" type="text" value="' . (!empty($_GET["login"]) ? $_GET["login"] : (isset($force_install_dolibarrlogin) ? $force_install_dolibarrlogin : '')) . '"' . (@$force_install_noedit == 2 && $force_install_dolibarrlogin !== null ? ' disabled' : '') . '></td></tr>';
|
||||||
print '<tr><td>'.$langs->trans("Password").' :</td><td>';
|
print '<tr><td>'.$langs->trans("Password").' :</td><td>';
|
||||||
print '<input type="password" name="pass"></td></tr>';
|
print '<input type="password" name="pass"></td></tr>';
|
||||||
print '<tr><td>'.$langs->trans("PasswordAgain").' :</td><td>';
|
print '<tr><td>'.$langs->trans("PasswordAgain").' :</td><td>';
|
||||||
|
|||||||
33
test/phpunit/zenfusion/functional/DolibarrInstallTest.php
Normal file
33
test/phpunit/zenfusion/functional/DolibarrInstallTest.php
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class ZenFusionInstallTest extends PHPUnit_Extensions_Selenium2TestCase
|
||||||
|
{
|
||||||
|
public function setUp()
|
||||||
|
{
|
||||||
|
$this->setHost('localhost');
|
||||||
|
$this->setPort(4444);
|
||||||
|
$this->setBrowserUrl('http://dev.zenfusion.fr');
|
||||||
|
$this->setBrowser('chrome');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setUpPage()
|
||||||
|
{
|
||||||
|
$this->url('/');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testInstallRedirect()
|
||||||
|
{
|
||||||
|
$this->assertContains('/install/index.php', $this->url());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testInstallPageTitle()
|
||||||
|
{
|
||||||
|
$this->assertContains('Dolibarr', $this->title());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testInstallProcess()
|
||||||
|
{
|
||||||
|
$this->byName('forminstall')->submit();
|
||||||
|
$this->assertContains('/install/check.php', $this->url());
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user