--- tests/Zend/OpenIdTest.php (revision 10886) +++ tests/Zend/OpenIdTest.php (working copy) @@ -150,6 +150,9 @@ unset($_SERVER['PATH_INFO']); $this->assertSame( 'http://www.test.com/test.php', Zend_OpenId::selfUrl() ); + + Zend_OpenId::$selfUrl = 'http://www.test.com/ok/'; + $this->assertSame('http://www.test.com/ok/', Zend_OpenId::selfUrl()); } /** Index: library/Zend/OpenId.php =================================================================== --- library/Zend/OpenId.php (revision 10886) +++ library/Zend/OpenId.php (working copy) @@ -65,6 +65,11 @@ * Allows enable/disable stoping execution of PHP script after redirect() */ static public $exitOnRedirect = true; + + /** + * Alternative request URL that can be used to override the default selfUrl() response + */ + static public $selfUrl = null; /** * Returns a full URL that was requested on current HTTP request. @@ -73,7 +78,9 @@ */ static public function selfUrl() { - if (isset($_SERVER['SCRIPT_URI'])) { + if (isset(self::$selfUrl)) { + return self::$selfUrl; + } else if (isset($_SERVER['SCRIPT_URI'])) { return $_SERVER['SCRIPT_URI']; } $url = '';