Changeset 15118
- Timestamp:
- 2007/07/24 14:14:05 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-module-update/test/class/page/LC_Page_Test.php
r15116 r15118 15 15 * @package Page 16 16 * @author LOCKON CO.,LTD. 17 * @version $Id $17 * @version $Id:LC_Page_Test.php 15116 2007-07-23 11:32:53Z nanasess $ 18 18 */ 19 19 class LC_Page_Test extends PHPUnit_TestCase { … … 110 110 $this->assertEquals(1, preg_match("/[a-f0-9]{40,}/", LC_Page::createToken())); 111 111 } 112 113 /** 114 * LC_Page::getLocation() のテストケース. 115 */ 116 function testGetLocation() { 117 $objPage = new LC_Page(); 118 $_SERVER['DOCUMENT_ROOT'] = realpath("../../../html"); 119 $url = $objPage->getLocation("../../../html/abouts/index.php"); 120 121 $this->assertEquals(SITE_URL . "abouts/index.php", $url); 122 unset($_SERVER['DOCUMENT_ROOT']); 123 } 124 125 /** 126 * LC_Page::getLocation() のテストケース. 127 * 128 * QueryString 付与 129 */ 130 function testGetLocationWithQueryString() { 131 $objPage = new LC_Page(); 132 $_SERVER['DOCUMENT_ROOT'] = realpath("../../../html"); 133 134 $queryString = array("mode" => "update", "type" => "text"); 135 $url = $objPage->getLocation("../../../html/abouts/index.php", $queryString); 136 137 $this->assertEquals(SITE_URL . "abouts/index.php?mode=update&type=text", $url); 138 unset($_SERVER['DOCUMENT_ROOT']); 139 } 140 141 /** 142 * LC_Page::getLocation() のテストケース. 143 * 144 * SSL_URL 使用 145 */ 146 function testGetLocationUseSSL() { 147 $objPage = new LC_Page(); 148 $_SERVER['DOCUMENT_ROOT'] = realpath("../../../html"); 149 150 $queryString = array("mode" => "update", "type" => "text"); 151 $url = $objPage->getLocation("../../../html/abouts/index.php", $queryString, true); 152 153 $this->assertEquals(SSL_URL . "abouts/index.php?mode=update&type=text", $url); 154 unset($_SERVER['DOCUMENT_ROOT']); 155 } 156 157 /** 158 * LC_Page::getLocation() のテストケース. 159 * 160 * DocumentRoot 指定 161 */ 162 function testGetLocationWithDocumentRoot() { 163 $objPage = new LC_Page(); 164 $documentRoot = realpath("../../../html"); 165 166 $queryString = array("mode" => "update", "type" => "text"); 167 $url = $objPage->getLocation("../../../html/abouts/index.php", array(), 168 false, $documentRoot); 169 170 $this->assertEquals(SITE_URL . "abouts/index.php", $url); 171 } 112 172 } 113 173 ?>
Note: See TracChangeset
for help on using the changeset viewer.