[Fusionforge-commits] r12213 - branches/Branch_5_1/tests/func/Site

Olivier Berger olberger at libremir.placard.fr.eu.org
Thu Feb 10 14:08:59 CET 2011


Author: olberger
Date: 2011-02-10 14:08:57 +0100 (Thu, 10 Feb 2011)
New Revision: 12213

Modified:
   branches/Branch_5_1/tests/func/Site/loginTest.php
Log:
Add tests on logout so that it behaves safe when HOST misconfigured

Modified: branches/Branch_5_1/tests/func/Site/loginTest.php
===================================================================
--- branches/Branch_5_1/tests/func/Site/loginTest.php	2011-02-10 12:57:34 UTC (rev 12212)
+++ branches/Branch_5_1/tests/func/Site/loginTest.php	2011-02-10 13:08:57 UTC (rev 12213)
@@ -53,6 +53,14 @@
 		$this->open( ROOT );
 		$this->click("link=Log In");
 		$this->waitForPageToLoad("30000");
+
+		// Check that current URL's base is the same as ROOT
+		// If the forge redirects to other URL than the one
+		// used to access it, then logout doesn't work (bug or
+		// feature ?)
+		$location=$this->getLocation();
+		$this->assertStringStartsWith('https://'.HOST.'/', $location, "You may need to set 'HOST' setting in test suite's config file to something compatible with 'web_host' defined in ini file");
+
 		$this->type("form_loginname", "admin");
 		$this->type("form_pw", "myadmin");
 		$this->click("login");
@@ -60,7 +68,9 @@
 		$this->assertTrue($this->isTextPresent("Forge Admin"));
 		$this->assertTrue($this->isTextPresent("Log Out"));
 		$this->logout();
-				
+		// Verify that logout is succesfull
+		$this->assertTrue($this->isTextPresent("Log In"));
+	
 		// Test with an empty password.
 		$this->open( ROOT );
 		$this->click("link=Log In");




More information about the Fusionforge-commits mailing list