Changeset 1015
- Timestamp:
- 11/09/07 14:41:37 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/util/net/http/stubHTTPURL.php
r777 r1015 188 188 } 189 189 190 $query .= $key . '=' . urlencode($value); 190 if($value !== '') { 191 $query .= $key . '=' . urlencode($value); 192 } else { 193 $query .= $key; 194 } 191 195 } else { 192 196 foreach ($value as $assoc_key => $single) { trunk/src/test/php/net/stubbles/util/net/http/stubHTTPURLTestCase.php
r719 r1015 170 170 171 171 /** 172 * assure that paramter without value is valid 173 * e.g.: http://example.org?wsdl 174 * http://example.org?key1&foo=bar&key2 175 */ 176 public function testKeyWithoutParam() 177 { 178 $http = stubHTTPURL::fromString('http://example.org/'); 179 $this->assertFalse($http->hasQuery()); 180 $http->addParam('key1', ''); 181 $this->assertTrue($http->hasQuery()); 182 $this->assertEqual($http->get(),'http://example.org/?key1'); 183 $http->addParam('foo', 'bar'); 184 $http->addParam('key2', ''); 185 $this->assertEqual($http->get(),'http://example.org/?key1&foo=bar&key2'); 186 } 187 188 /** 172 189 * assure that wrong parameters throw an exception 173 190 */
