diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php index 8d5cd9c8495..e55aaeb7516 100644 --- a/htdocs/core/lib/fichinter.lib.php +++ b/htdocs/core/lib/fichinter.lib.php @@ -163,6 +163,12 @@ function fichinter_admin_prepare_head() return $head; } +/** + * Prepare array with list of tabs + * + * @param Object $object Object related to tabs + * @return array Array of tabs to show + */ function fichinter_rec_prepare_head($object) { global $langs, $conf; //, $user; diff --git a/test/phpunit/BonPrelevementTest.php b/test/phpunit/BonPrelevementTest.php index 0124b25e6c6..a6ea54b8460 100644 --- a/test/phpunit/BonPrelevementTest.php +++ b/test/phpunit/BonPrelevementTest.php @@ -74,14 +74,24 @@ class BonPrelevementTest extends PHPUnit_Framework_TestCase print "\n"; } - // Static methods - public static function setUpBeforeClass() + /** + * setUpBeforeClass + * + * @return void + */ + public static function setUpBeforeClass() { global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. print __METHOD__."\n"; } + + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { global $conf,$user,$langs,$db; diff --git a/test/phpunit/functional/InstallTest.php b/test/phpunit/functional/InstallTest.php index 534d1d602c0..f444d08eec0 100644 --- a/test/phpunit/functional/InstallTest.php +++ b/test/phpunit/functional/InstallTest.php @@ -42,6 +42,11 @@ class InstallTest extends PHPUnit_Extensions_Selenium2TestCase ) ); + /** + * setUpBeforeClass + * + * @return void + */ public static function setUpBeforeClass() { // Make sure we backup and remove the configuration file to force new install. @@ -54,12 +59,22 @@ class InstallTest extends PHPUnit_Extensions_Selenium2TestCase self::shareSession(true); } + /** + * dropTestDatabase + * + * @return void + */ protected static function dropTestDatabase() { $mysqli = new mysqli(self::$db_host, self::$db_admin_user, self::$db_admin_pass); $mysqli->query("DROP DATABASE " . self::$db_name); } + /** + * tearDownAfterClass + * + * @return void + */ public static function tearDownAfterClass() { // Remove the generated configuration and restore the backed up file. @@ -70,6 +85,11 @@ class InstallTest extends PHPUnit_Extensions_Selenium2TestCase self::dropTestDatabase(); } + /** + * setUp + * + * @return void + */ public function setUp() { // Populating the database can take quite long. @@ -77,17 +97,32 @@ class InstallTest extends PHPUnit_Extensions_Selenium2TestCase $this->setBrowserUrl(self::$url); } + /** + * testInstallRedirect + * + * @return void + */ public function testInstallRedirect() { $this->url('/'); $this->assertContains('/install/index.php', $this->url()); } + /** + * testInstallPageTitle + * + * @return void + */ public function testInstallPageTitle() { $this->assertContains('Dolibarr', $this->title()); } + /** + * testInstallProcess + * + * @return void + */ public function testInstallProcess() { // FIXME: the button itself should have an ID @@ -95,6 +130,11 @@ class InstallTest extends PHPUnit_Extensions_Selenium2TestCase $this->assertContains('/install/check.php', $this->url()); } + /** + * testCheckPage + * + * @return void + */ public function testCheckPage() { $unavailable_choices = $this->byId('navail_choices'); @@ -109,6 +149,11 @@ class InstallTest extends PHPUnit_Extensions_Selenium2TestCase $this->assertContains('/install/fileconf.php', $this->url()); } + /** + * testForm + * + * @return void + */ public function testForm() { $this->assertFalse($this->byClassName('hideroot')->displayed()); @@ -153,12 +198,22 @@ class InstallTest extends PHPUnit_Extensions_Selenium2TestCase $this->byId('db_pass_root')->value(''); } + /** + * testFormSubmit + * + * @return void + */ public function testFormSubmit() { $this->byName('forminstall')->submit(); $this->assertContains('/install/step1.php', $this->url()); } + /** + * testStep1 + * + * @return void + */ public function testStep1() { $this->assertFalse($this->byId('pleasewait')->displayed()); @@ -170,6 +225,11 @@ class InstallTest extends PHPUnit_Extensions_Selenium2TestCase $this->assertContains('/install/step2.php', $this->url()); } + /** + * testStep2 + * + * @return void + */ public function testStep2() { $this->byName('forminstall')->submit(); @@ -178,6 +238,11 @@ class InstallTest extends PHPUnit_Extensions_Selenium2TestCase // There is no step 3 + /** + * testStep4 + * + * @return void + */ public function testStep4() { // FIXME: should have an ID @@ -191,6 +256,11 @@ class InstallTest extends PHPUnit_Extensions_Selenium2TestCase $this->assertContains('/install/step5.php', $this->url()); } + /** + * testStep5 + * + * @return void + */ public function testStep5() { // FIXME: this button should have an ID @@ -198,6 +268,11 @@ class InstallTest extends PHPUnit_Extensions_Selenium2TestCase $this->assertContains('/admin/index.php', $this->url()); } + /** + * testFirstLogin + * + * @return void + */ public function testFirstLogin() { $this->assertEquals('login', $this->byTag('form')->attribute('id'));