From 2c000c20da9cd2c184b23472e6142f679950668d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Sat, 23 Jul 2016 01:53:11 +0200 Subject: [PATCH 1/2] Prevent PHP notice on unitialized variables. These variables are expected to be uninitialized when the forced install process is not used. --- htdocs/install/fileconf.php | 6 ++-- htdocs/install/step4.php | 2 +- .../functional/DolibarrInstallTest.php | 33 +++++++++++++++++++ 3 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 test/phpunit/zenfusion/functional/DolibarrInstallTest.php diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 1782be430bc..32e495fffaf 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -151,7 +151,7 @@ if (! empty($force_install_message)) trans("DocumentsDirectory"); ?> " + value="" @@ -506,7 +506,7 @@ if (! empty($force_install_message)) class="needroot" value="db->type,$conf->db->host,$conf->db->user,$conf->db- if ($db->ok) { print ''.$langs->trans("DolibarrAdminLogin").' :'; - print ''; + print ''; print ''.$langs->trans("Password").' :'; print ''; print ''.$langs->trans("PasswordAgain").' :'; diff --git a/test/phpunit/zenfusion/functional/DolibarrInstallTest.php b/test/phpunit/zenfusion/functional/DolibarrInstallTest.php new file mode 100644 index 00000000000..5fcb37fdb63 --- /dev/null +++ b/test/phpunit/zenfusion/functional/DolibarrInstallTest.php @@ -0,0 +1,33 @@ +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()); + } +} From 1cfa26d40045f2c6ba1505861941cf6dc47309e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Sat, 23 Jul 2016 01:54:09 +0200 Subject: [PATCH 2/2] Fix HTML syntax for forced install process. Make sure we have a space between attributes. --- htdocs/install/fileconf.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 32e495fffaf..17784e8b766 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -131,7 +131,7 @@ if (! empty($force_install_message)) value="" name="main_dir" > @@ -162,7 +162,7 @@ if (! empty($force_install_message)) value="" name="main_data_dir" > @@ -193,7 +193,7 @@ if (! empty($force_install_message)) name="main_url" value=" " > @@ -214,10 +214,10 @@ if (! empty($force_install_message)) > @@ -245,7 +245,7 @@ if (! empty($force_install_message)) name="db_name" value="" > @@ -325,7 +325,7 @@ if (! empty($force_install_message)) > @@ -480,7 +480,7 @@ if (! empty($force_install_message)) class="needroot" value="" >