Changeset 19199
- Timestamp:
- 09/11/08 23:23:12 (4 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/php/ZendFramework_ext/library/Diggin/Http/Client/Adapter/TestPlus.php
r18901 r19199 63 63 64 64 /** 65 * size of response66 * 67 * @var unknown_type65 * random status 66 * 67 * @var array 68 68 */ 69 69 protected $_statusRandom; 70 71 72 protected $_connectiingTime = 0; 70 73 71 74 /** * … … 74 77 protected $_randomResponseBodyInterval; 75 78 76 79 /** 80 * test response Body 81 * 82 * @var array 83 */ 77 84 protected $_testResponseBody = array(); 78 85 … … 86 93 { 87 94 if (is_null($resposeBody)) { 88 $resposeBody = <<<RESPONSEBODY 89 <html lang="ja"> 90 <head> 91 <body> 92 this is testplus<br /> 93 </body> 94 </html> 95 RESPONSEBODY; 95 $resposeBody = '<html lang="ja">'.PHP_EOL. 96 '<head>'.PHP_EOL. 97 '<body>'.PHP_EOL. 98 'this is testplus<br />'.PHP_EOL. 99 '</body>'.PHP_EOL. 100 '</html>'; 96 101 } 97 102 98 103 if (is_null($responseHeader)) { 99 $responseHeader = <<<RESPONSEHEADER100 HTTP/1.1 200 OK 101 Date: Sat, 02 Aug 2008 15:17:11 GMT 102 Server: Apache/2.2.6 (Win32) mod_ssl/2.2.6 OpenSSL/0.9.8e PHP/5.2.5 103 Last-modified: Sun, 29 Jun 2008 21:20:50 GMT 104 Accept-ranges: bytes 105 Content-length: 1000 106 Connection: close 107 Content-type: text/html 108 RESPONSEHEADER; 104 $responseHeader = 105 "HTTP/1.1 200 OK" ."\r\n". 106 "Date: Sat, 02 Aug 2008 15:17:11 GMT"."\r\n". 107 "Server: Apache/2.2.6 (Win32) mod_ssl/2.2.6 OpenSSL/0.9.8e PHP/5.2.5"."\r\n". 108 "Last-modified: Sun, 29 Jun 2008 21:20:50 GMT"."\r\n". 109 "Accept-ranges: bytes" . "\r\n" . 110 "Content-length: 1000" . "\r\n" . 111 "Connection: close" . "\r\n" . 112 "Content-type: text/xml"; 113 109 114 } 110 115 … … 140 145 public function connect($host, $port = 80, $secure = false) 141 146 { 142 //require_once 'Zend/Http/Client/Adapter/Exception.php'; 143 //throw new Zend_Http_Client_Adapter_Exception('Unable to set the connection timeout'); 147 //fake time out 148 sleep($this->_connectiingTime); 149 if ($this->_connectiingTime > (int) $this->config['timeout']) { 150 require_once 'Diggin/Http/Client/Adapter/Exception.php'; 151 throw new Diggin_Http_Client_Adapter_Exception('Unable to set the connection timeout(fake)'); 152 } 144 153 } 145 154 … … 300 309 $this->_statusRandom = $config; 301 310 } 302 303 //@todo 304 public function setConnectionTime($time, $randomFlg = false) 305 { 306 311 312 /** 313 * set connect time 314 * 315 * @param int $time 316 */ 317 public function setConnectingTime($time) 318 { 319 $this->_connectiingTime = $time; 307 320 } 308 321 … … 314 327 //@todo array_shift(func_get_args) 315 328 if (is_null($addResponseBody)) { 316 $addResponseBody = <<<RESPONSEBODY 317 <html lang="ja"> 318 <head> 319 <body> 320 This is testplus <br /> 321 222222222222222222 322 </body> 323 </html> 324 RESPONSEBODY; 325 //$_testResponseBody[2] = <<<RESPONSEBODY 326 //<html lang="ja"> 327 //<head> 328 //<body> 329 //this is testplus <br /> 330 //test!test! 331 //</body> 332 //</html> 333 //RESPONSEBODY; 329 $addResponseBody = '<html lang="ja">'. 330 '<head>'. 331 '<body>'. 332 'this is testplus!!!!!<br />'. 333 '</body>'. 334 '</html>'; 334 335 } 335 336
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)