* A test case for faked HTTP requests. This is faked because we *set*
* $_REQUEST here. This should be made better in PHP6... :(
*
- * @author Roland Haeder <webmaster@mxchange.org>
+ * @author Roland Haeder <webmaster@ship-simu.org>
* @version 0.0.0
* @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software
* @license GNU GPL 3.0 or any newer version
- * @link http://www.ship-simu.org
+ * @link http://www.ship-simu.org
* @see http://www.phpunit.de
*
* This program is free software: you can redistribute it and/or modify
));
}
}
+
+ /**
+ * Now fake a request array and try the test on it again
+ *
+ * @return void
+ */
+ public function testFakeRequestElement () {
+ // Fake the request here
+ $_REQUEST = array('test_key' => "test_value");
+
+ // Again get an instance
+ $requestInstance = HttpRequest::createHttpRequest();
+
+ // Get the element
+ $testValue = $requestInstance->getRequestElement('test_key');
+
+ // Is it the same?
+ if ($testValue !== "test_value") {
+ // Something went wrong
+ $this->fail(sprintf("[%s] Unexpected value %s (%s) from test key received.",
+ $requestInstance->__toString(),
+ $testValue,
+ gettype($testValue)
+ ));
+ }
+ }
}
?>