[Fusionforge-commits] r11293 - trunk/tests/func/RBAC

Roland Mas lolando at libremir.placard.fr.eu.org
Tue Nov 2 11:26:09 CET 2010


Author: lolando
Date: 2010-11-02 11:26:09 +0100 (Tue, 02 Nov 2010)
New Revision: 11293

Modified:
   trunk/tests/func/RBAC/rbacTest.php
Log:
Work around project_registration_restricted in RBAC testing

Modified: trunk/tests/func/RBAC/rbacTest.php
===================================================================
--- trunk/tests/func/RBAC/rbacTest.php	2010-11-02 09:52:00 UTC (rev 11292)
+++ trunk/tests/func/RBAC/rbacTest.php	2010-11-02 10:26:09 UTC (rev 11293)
@@ -126,11 +126,35 @@
 		$this->assertFalse($this->isTextPresent("projapp Lastname"));
 		$this->assertTrue($this->isTextPresent("newsmod Lastname"));
 
-		// Register project as unprivileged user
+		// Register unprivileged user
 		$this->createUser ("toto") ;
 		$this->switchUser ("toto") ;
+
+		// Temporarily grant project approval rights to user
+		$this->click("link=Site Admin");
+		$this->waitForPageToLoad("30000");
+		$this->select ("//form[contains(@action,'globalroleedit.php')]//select[@name='role_id']", "label=Project approvers") ;
+		$this->click ("//form[contains(@action,'globalroleedit.php')]//input[@value='Edit Role']") ;
+		$this->waitForPageToLoad("30000");
+		$this->type ("//form[contains(@action,'globalroleedit.php')]//input[@name='form_unix_name']", "toto") ;
+		$this->click ("//input[@value='Add User']") ;
+		$this->waitForPageToLoad("30000");
+		$this->assertTrue($this->isTextPresent("toto Lastname"));
+		
+		// Register project
 		$this->registerProject ("TotoProject", "toto") ;
 
+		// Revoke project approval rights
+		// (For cases where project_registration_restricted=true)
+		$this->click("link=Site Admin");
+		$this->waitForPageToLoad("30000");
+		$this->select ("//form[contains(@action,'globalroleedit.php')]//select[@name='role_id']", "label=Project approvers") ;
+		$this->click ("//form[contains(@action,'globalroleedit.php')]//input[@value='Edit Role']") ;
+		$this->waitForPageToLoad("30000");
+		$this->click ("//a[contains(@href,'/users/toto')]/../input[@name='rmuser']") ;
+		$this->waitForPageToLoad("30000");
+		$this->assertFalse($this->isTextPresent("toto Lastname"));
+
 		// Try approving it as two users without the right to do so
 		$this->open( ROOT . '/admin/approve-pending.php') ;
 		$this->waitForPageToLoad("30000");




More information about the Fusionforge-commits mailing list