Repository: WordPress/Requests (language: php)

Issue:
Tests configuration setup
PR #457 contains a commit adding a test to the config.
This is the second time I've had to create a separate PR to add tests which were not automatically being run. Also see #366.

I'd like to propose removing the separate test suite configurations in favour of a generic setup which will automatically discover any new tests added to the `tests` directory.

The PHPUnit `--filter` CLI argument is powerful enough to handle selective running of the tests for most PHPUnit versions.

If needs be, for older PHPUnit versions, a `@group` annotation could be added to various tests to still allow them to be run in groups alike to the original testsuites.


Discussion / hints:
Probably would be good to take this issue into account when setting up the namespaces for the tests for Requests 2.0.0. Also see #460.

Fix patch:
diff --git a/.phpcs.xml.dist b/.phpcs.xml.dist
index 23ccb1c35..bca2cd08f 100644
--- a/.phpcs.xml.dist
+++ b/.phpcs.xml.dist
@@ -17,7 +17,7 @@
 
 	<!-- Third party files and build files don't need to comply with these coding standards. -->
 	<exclude-pattern>*/library/Requests/IRI\.php$</exclude-pattern>
-	<exclude-pattern>*/tests/IRI\.php$</exclude-pattern>
+	<exclude-pattern>*/tests/IRITest\.php$</exclude-pattern>
 	<exclude-pattern>*/vendor/*</exclude-pattern>
 	<exclude-pattern>*/tests/coverage/</exclude-pattern>
 
diff --git a/composer.json b/composer.json
index 1b61196b2..00d7f0637 100644
--- a/composer.json
+++ b/composer.json
@@ -54,6 +54,11 @@
       "Requests": "library/"
     }
   },
+  "autoload-dev": {
+    "psr-4": {
+      "Requests\\Tests\\": "tests/"
+    }
+  },
   "scripts": {
     "lint": [
       "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --exclude vendor --exclude .git"
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 48856b5eb..d14f496a5 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -8,26 +8,8 @@
 	verbose="true"
 	>
 	<testsuites>
-		<testsuite name="Authentication">
-			<directory suffix=".php">tests/Auth</directory>
-		</testsuite>
-		<testsuite name="Transports">
-			<directory suffix=".php">tests/Transport</directory>
-		</testsuite>
-		<testsuite name="Proxies">
-			<directory suffix=".php">tests/Proxy</directory>
-		</testsuite>
-		<testsuite name="General">
-			<file>tests/ChunkedEncoding.php</file>
-			<file>tests/Cookies.php</file>
-			<file>tests/Encoding.php</file>
-			<file>tests/IDNAEncoder.php</file>
-			<file>tests/IRI.php</file>
-			<file>tests/Requests.php</file>
-			<file>tests/Response/Headers.php</file>
-			<file>tests/Session.php</file>
-			<file>tests/SSL.php</file>
-			<file>tests/Utility/FilteredIterator.php</file>
+		<testsuite name="RequestsTests">
+			<directory suffix="Test.php">tests</directory>
 		</testsuite>
 	</testsuites>
 


Test patch:
diff --git a/tests/Auth/Basic.php b/tests/Auth/BasicTest.php
similarity index 94%
rename from tests/Auth/Basic.php
rename to tests/Auth/BasicTest.php
index eff132613..d7bbdcb96 100644
--- a/tests/Auth/Basic.php
+++ b/tests/Auth/BasicTest.php
@@ -1,6 +1,12 @@
 <?php
 
-class RequestsTest_Auth_Basic extends RequestsTest_TestCase {
+namespace Requests\Tests\Auth;
+
+use Requests;
+use Requests\Tests\TestCase;
+use Requests_Auth_Basic;
+
+class BasicTest extends TestCase {
 	public static function transportProvider() {
 		return array(
 			array('Requests_Transport_fsockopen'),
diff --git a/tests/ChunkedEncoding.php b/tests/ChunkedEncodingTest.php
similarity index 90%
rename from tests/ChunkedEncoding.php
rename to tests/ChunkedEncodingTest.php
index e1c03aad7..f890c8b06 100644
--- a/tests/ChunkedEncoding.php
+++ b/tests/ChunkedEncodingTest.php
@@ -1,6 +1,12 @@
 <?php
 
-class RequestsTest_ChunkedDecoding extends RequestsTest_TestCase {
+namespace Requests\Tests;
+
+use Requests;
+use Requests\Tests\Mock\TransportMock;
+use Requests\Tests\TestCase;
+
+class ChunkedDecodingTest extends TestCase {
 	public static function chunkedProvider() {
 		return array(
 			array(
@@ -34,7 +40,7 @@ public static function chunkedProvider() {
 	 * @dataProvider chunkedProvider
 	 */
 	public function testChunked($body, $expected) {
-		$transport          = new RequestsTest_Mock_Transport();
+		$transport          = new TransportMock();
 		$transport->body    = $body;
 		$transport->chunked = true;
 
@@ -62,7 +68,7 @@ public static function notChunkedProvider() {
 	 * @dataProvider notChunkedProvider
 	 */
 	public function testNotActuallyChunked($body) {
-		$transport          = new RequestsTest_Mock_Transport();
+		$transport          = new TransportMock();
 		$transport->body    = $body;
 		$transport->chunked = true;
 
@@ -80,7 +86,7 @@ public function testNotActuallyChunked($body) {
 	 * that they're lying to us
 	 */
 	public function testMixedChunkiness() {
-		$transport          = new RequestsTest_Mock_Transport();
+		$transport          = new TransportMock();
 		$transport->body    = "02\r\nab\r\nNot actually chunked!";
 		$transport->chunked = true;
 
diff --git a/tests/Cookies.php b/tests/CookiesTest.php
similarity index 98%
rename from tests/Cookies.php
rename to tests/CookiesTest.php
index 03c6aa5ea..24655544a 100644
--- a/tests/Cookies.php
+++ b/tests/CookiesTest.php
@@ -1,6 +1,17 @@
 <?php
 
-class RequestsTest_Cookies extends RequestsTest_TestCase {
+namespace Requests\Tests;
+
+use Requests;
+use Requests\Tests\TestCase;
+use Requests_Cookie;
+use Requests_Cookie_Jar;
+use Requests_Exception;
+use Requests_IRI;
+use Requests_Response_Headers;
+use Requests_Utility_CaseInsensitiveDictionary;
+
+class CookiesTest extends TestCase {
 	public function testBasicCookie() {
 		$cookie = new Requests_Cookie('requests-testcookie', 'testvalue');
 
diff --git a/tests/Encoding.php b/tests/EncodingTest.php
similarity index 95%
rename from tests/Encoding.php
rename to tests/EncodingTest.php
index 800fddcf9..74d2a65ac 100644
--- a/tests/Encoding.php
+++ b/tests/EncodingTest.php
@@ -1,6 +1,11 @@
 <?php
 
-class RequestsTests_Encoding extends RequestsTest_TestCase {
+namespace Requests\Tests;
+
+use Requests;
+use Requests\Tests\TestCase;
+
+class EncodingTest extends TestCase {
 	protected static function mapData($type, $data) {
 		$real_data = array();
 		foreach ($data as $value) {
diff --git a/tests/IDNAEncoder.php b/tests/IDNAEncoderTest.php
similarity index 95%
rename from tests/IDNAEncoder.php
rename to tests/IDNAEncoderTest.php
index 277fc5e9d..b0bd9647d 100644
--- a/tests/IDNAEncoder.php
+++ b/tests/IDNAEncoderTest.php
@@ -1,6 +1,11 @@
 <?php
 
-class RequestsTest_IDNAEncoder extends RequestsTest_TestCase {
+namespace Requests\Tests;
+
+use Requests\Tests\TestCase;
+use Requests_IDNAEncoder;
+
+class IDNAEncoderTest extends TestCase {
 	public static function specExamples() {
 		return array(
 			array(
diff --git a/tests/IRI.php b/tests/IRITest.php
similarity index 99%
rename from tests/IRI.php
rename to tests/IRITest.php
index cef75078f..a0662929f 100644
--- a/tests/IRI.php
+++ b/tests/IRITest.php
@@ -40,7 +40,12 @@
  *
  */
 
-class RequestsTest_IRI extends RequestsTest_TestCase
+namespace Requests\Tests;
+
+use Requests_IRI;
+use Requests\Tests\TestCase;
+
+class IRITest extends TestCase
 {
 	public static function rfc3986_tests()
 	{
diff --git a/tests/Mock/RawTransport.php b/tests/Mock/RawTransportMock.php
similarity index 82%
rename from tests/Mock/RawTransport.php
rename to tests/Mock/RawTransportMock.php
index 94dd91660..c807e01c9 100644
--- a/tests/Mock/RawTransport.php
+++ b/tests/Mock/RawTransportMock.php
@@ -1,6 +1,10 @@
 <?php
 
-class RequestsTest_Mock_RawTransport implements Requests_Transport {
+namespace Requests\Tests\Mock;
+
+use Requests_Transport;
+
+class RawTransportMock implements Requests_Transport {
 	public $data = '';
 	public function request($url, $headers = array(), $data = array(), $options = array()) {
 		return $this->data;
diff --git a/tests/Mock/Transport.php b/tests/Mock/TransportMock.php
similarity index 96%
rename from tests/Mock/Transport.php
rename to tests/Mock/TransportMock.php
index 42580fab2..a0af0a186 100644
--- a/tests/Mock/Transport.php
+++ b/tests/Mock/TransportMock.php
@@ -1,6 +1,10 @@
 <?php
 
-class RequestsTest_Mock_Transport implements Requests_Transport {
+namespace Requests\Tests\Mock;
+
+use Requests_Transport;
+
+class TransportMock implements Requests_Transport {
 	public $code        = 200;
 	public $chunked     = false;
 	public $body        = 'Test Body';
diff --git a/tests/Proxy/HTTP.php b/tests/Proxy/HTTPTest.php
similarity index 96%
rename from tests/Proxy/HTTP.php
rename to tests/Proxy/HTTPTest.php
index a6de95deb..2a142057d 100644
--- a/tests/Proxy/HTTP.php
+++ b/tests/Proxy/HTTPTest.php
@@ -1,6 +1,12 @@
 <?php
 
-class RequestsTest_Proxy_HTTP extends RequestsTest_TestCase {
+namespace Requests\Tests\Proxy;
+
+use Requests;
+use Requests\Tests\TestCase;
+use Requests_Proxy_HTTP;
+
+class HTTPTest extends TestCase {
 	protected function checkProxyAvailable($type = '') {
 		switch ($type) {
 			case 'auth':
diff --git a/tests/Requests.php b/tests/RequestsTest.php
similarity index 88%
rename from tests/Requests.php
rename to tests/RequestsTest.php
index 8e04e1465..0e7f36244 100644
--- a/tests/Requests.php
+++ b/tests/RequestsTest.php
@@ -1,6 +1,14 @@
 <?php
 
-class RequestsTest_Requests extends RequestsTest_TestCase {
+namespace Requests\Tests;
+
+use Requests;
+use Requests\Tests\Mock\RawTransportMock;
+use Requests\Tests\Mock\TransportMock;
+use Requests\Tests\TestCase;
+use Requests_Response_Headers;
+
+class RequestsTest extends TestCase {
 
 	public function testInvalidProtocol() {
 		$this->expectException('Requests_Exception');
@@ -17,7 +25,7 @@ public function testDefaultTransport() {
 	 * Standard response header parsing
 	 */
 	public function testHeaderParsing() {
-		$transport       = new RequestsTest_Mock_RawTransport();
+		$transport       = new RawTransportMock();
 		$transport->data =
 			"HTTP/1.0 200 OK\r\n" .
 			"Host: localhost\r\n" .
@@ -52,7 +60,7 @@ public function testHeaderParsing() {
 	}
 
 	public function testProtocolVersionParsing() {
-		$transport       = new RequestsTest_Mock_RawTransport();
+		$transport       = new RawTransportMock();
 		$transport->data =
 			"HTTP/1.0 200 OK\r\n" .
 			"Host: localhost\r\n\r\n";
@@ -66,7 +74,7 @@ public function testProtocolVersionParsing() {
 	}
 
 	public function testRawAccess() {
-		$transport       = new RequestsTest_Mock_RawTransport();
+		$transport       = new RawTransportMock();
 		$transport->data =
 			"HTTP/1.0 200 OK\r\n" .
 			"Host: localhost\r\n\r\n" .
@@ -83,7 +91,7 @@ public function testRawAccess() {
 	 * Headers with only \n delimiting should be treated as if they're \r\n
 	 */
 	public function testHeaderOnlyLF() {
-		$transport       = new RequestsTest_Mock_RawTransport();
+		$transport       = new RawTransportMock();
 		$transport->data = "HTTP/1.0 200 OK\r\nTest: value\nAnother-Test: value\r\n\r\n";
 
 		$options  = array(
@@ -101,7 +109,7 @@ public function testHeaderOnlyLF() {
 	 * new issue, and update your server/proxy to support a proper protocol.
 	 */
 	public function testInvalidProtocolVersion() {
-		$transport       = new RequestsTest_Mock_RawTransport();
+		$transport       = new RawTransportMock();
 		$transport->data = "HTTP/0.9 200 OK\r\n\r\n<p>Test";
 
 		$options = array(
@@ -117,7 +125,7 @@ public function testInvalidProtocolVersion() {
 	 * HTTP/0.9 also appears to use a single CRLF instead of two.
 	 */
 	public function testSingleCRLFSeparator() {
-		$transport       = new RequestsTest_Mock_RawTransport();
+		$transport       = new RawTransportMock();
 		$transport->data = "HTTP/0.9 200 OK\r\n<p>Test";
 
 		$options = array(
@@ -130,7 +138,7 @@ public function testSingleCRLFSeparator() {
 	}
 
 	public function testInvalidStatus() {
-		$transport       = new RequestsTest_Mock_RawTransport();
+		$transport       = new RawTransportMock();
 		$transport->data = "HTTP/1.1 OK\r\nTest: value\nAnother-Test: value\r\n\r\nTest";
 
 		$options = array(
@@ -143,7 +151,7 @@ public function testInvalidStatus() {
 	}
 
 	public function test30xWithoutLocation() {
-		$transport       = new RequestsTest_Mock_Transport();
+		$transport       = new TransportMock();
 		$transport->code = 302;
 
 		$options  = array(
diff --git a/tests/Response/Headers.php b/tests/Response/HeadersTest.php
similarity index 91%
rename from tests/Response/Headers.php
rename to tests/Response/HeadersTest.php
index 65f2b838b..34224428f 100644
--- a/tests/Response/Headers.php
+++ b/tests/Response/HeadersTest.php
@@ -1,6 +1,11 @@
 <?php
 
-class RequestsTest_Response_Headers extends RequestsTest_TestCase {
+namespace Requests\Tests\Response;
+
+use Requests\Tests\TestCase;
+use Requests_Response_Headers;
+
+class HeadersTest extends TestCase {
 	public function testArrayAccess() {
 		$headers                 = new Requests_Response_Headers();
 		$headers['Content-Type'] = 'text/plain';
diff --git a/tests/SSL.php b/tests/SSLTest.php
similarity index 96%
rename from tests/SSL.php
rename to tests/SSLTest.php
index a23ccd696..7f3c462cd 100644
--- a/tests/SSL.php
+++ b/tests/SSLTest.php
@@ -1,6 +1,11 @@
 <?php
 
-class RequestsTest_SSL extends RequestsTest_TestCase {
+namespace Requests\Tests;
+
+use Requests\Tests\TestCase;
+use Requests_SSL;
+
+class SSLTest extends TestCase {
 	public static function domainMatchProvider() {
 		return array(
 			array('example.com', 'example.com'),
diff --git a/tests/Session.php b/tests/SessionTest.php
similarity index 98%
rename from tests/Session.php
rename to tests/SessionTest.php
index b8e465dde..448c2e248 100644
--- a/tests/Session.php
+++ b/tests/SessionTest.php
@@ -1,6 +1,11 @@
 <?php
 
-class RequestsTest_Session extends RequestsTest_TestCase {
+namespace Requests\Tests;
+
+use Requests\Tests\TestCase;
+use Requests_Session;
+
+class SessionTest extends TestCase {
 	public function testURLResolution() {
 		$session = new Requests_Session(httpbin('/'));
 
diff --git a/tests/TestCase.php b/tests/TestCase.php
index f464f86ed..da090ca9c 100644
--- a/tests/TestCase.php
+++ b/tests/TestCase.php
@@ -1,7 +1,9 @@
 <?php
 
-use Yoast\PHPUnitPolyfills\TestCases\TestCase;
+namespace Requests\Tests;
 
-class RequestsTest_TestCase extends TestCase {
+use Yoast\PHPUnitPolyfills\TestCases\TestCase as Polyfill_TestCase;
+
+class TestCase extends Polyfill_TestCase {
 
 }
diff --git a/tests/Transport/Base.php b/tests/Transport/BaseTestCase.php
similarity index 98%
rename from tests/Transport/Base.php
rename to tests/Transport/BaseTestCase.php
index 066c5ff5a..81ecd2679 100644
--- a/tests/Transport/Base.php
+++ b/tests/Transport/BaseTestCase.php
@@ -1,6 +1,15 @@
 <?php
 
-abstract class RequestsTest_Transport_Base extends RequestsTest_TestCase {
+namespace Requests\Tests\Transport;
+
+use Requests;
+use Requests\Tests\Mock\TransportMock;
+use Requests\Tests\TestCase;
+use Requests_Exception;
+use Requests_Hooks;
+use Requests_Response;
+
+abstract class BaseTestCase extends TestCase {
 	public function set_up() {
 		$callback  = array($this->transport, 'test');
 		$supported = call_user_func($callback);
@@ -383,7 +392,7 @@ public static function statusCodeSuccessProvider() {
 	 * @dataProvider statusCodeSuccessProvider
 	 */
 	public function testStatusCode($code, $success) {
-		$transport       = new RequestsTest_Mock_Transport();
+		$transport       = new TransportMock();
 		$transport->code = $code;
 
 		$url = sprintf(httpbin('/status/%d'), $code);
@@ -401,7 +410,7 @@ public function testStatusCode($code, $success) {
 	 * @dataProvider statusCodeSuccessProvider
 	 */
 	public function testStatusCodeThrow($code, $success) {
-		$transport       = new RequestsTest_Mock_Transport();
+		$transport       = new TransportMock();
 		$transport->code = $code;
 
 		$url     = sprintf(httpbin('/status/%d'), $code);
@@ -431,7 +440,7 @@ public function testStatusCodeThrow($code, $success) {
 	 * @dataProvider statusCodeSuccessProvider
 	 */
 	public function testStatusCodeThrowAllowRedirects($code, $success) {
-		$transport       = new RequestsTest_Mock_Transport();
+		$transport       = new TransportMock();
 		$transport->code = $code;
 
 		$url     = sprintf(httpbin('/status/%d'), $code);
@@ -455,7 +464,7 @@ public function testStatusCodeThrowAllowRedirects($code, $success) {
 	}
 
 	public function testStatusCodeUnknown() {
-		$transport       = new RequestsTest_Mock_Transport();
+		$transport       = new TransportMock();
 		$transport->code = 599;
 
 		$options = array(
@@ -468,7 +477,7 @@ public function testStatusCodeUnknown() {
 	}
 
 	public function testStatusCodeThrowUnknown() {
-		$transport       = new RequestsTest_Mock_Transport();
+		$transport       = new TransportMock();
 		$transport->code = 599;
 
 		$options = array(
diff --git a/tests/Transport/cURL.php b/tests/Transport/CURLTest.php
similarity index 96%
rename from tests/Transport/cURL.php
rename to tests/Transport/CURLTest.php
index 7f7c41774..13567dd6f 100644
--- a/tests/Transport/cURL.php
+++ b/tests/Transport/CURLTest.php
@@ -1,6 +1,11 @@
 <?php
 
-class RequestsTest_Transport_cURL extends RequestsTest_Transport_Base {
+namespace Requests\Tests\Transport;
+
+use Requests;
+use Requests\Tests\Transport\BaseTestCase;
+
+class CurlTest extends BaseTestCase {
 	protected $transport = 'Requests_Transport_cURL';
 
 	public function testBadIP() {
diff --git a/tests/Transport/fsockopen.php b/tests/Transport/FsockopenTest.php
similarity index 89%
rename from tests/Transport/fsockopen.php
rename to tests/Transport/FsockopenTest.php
index f77c154a1..c8b404961 100644
--- a/tests/Transport/fsockopen.php
+++ b/tests/Transport/FsockopenTest.php
@@ -1,6 +1,12 @@
 <?php
 
-class RequestsTest_Transport_fsockopen extends RequestsTest_Transport_Base {
+namespace Requests\Tests\Transport;
+
+use Requests;
+use Requests\Tests\Transport\BaseTestCase;
+use Requests_Hooks;
+
+class FsockopenTest extends BaseTestCase {
 	protected $transport = 'Requests_Transport_fsockopen';
 
 	public function testBadIP() {
diff --git a/tests/Utility/FilteredIterator.php b/tests/Utility/FilteredIteratorTest.php
similarity index 83%
rename from tests/Utility/FilteredIterator.php
rename to tests/Utility/FilteredIteratorTest.php
index 01f9e0a2b..5931a33bd 100644
--- a/tests/Utility/FilteredIterator.php
+++ b/tests/Utility/FilteredIteratorTest.php
@@ -1,6 +1,13 @@
 <?php
 
-class RequestsTest_Utility_FilteredIterator extends RequestsTest_TestCase {
+namespace Requests\Tests\Utility;
+
+use ArrayIterator;
+use ReflectionClass;
+use Requests\Tests\TestCase;
+use Requests_Utility_FilteredIterator;
+
+class FilteredIteratorTest extends TestCase {
 	/**
 	 * @dataProvider dataSerializeDeserializeObjects
 	 */
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index 10aa38155..ba540c175 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -24,27 +24,51 @@ function define_from_env($name, $default = false) {
 require_once dirname(__DIR__) . '/library/Requests.php';
 Requests::register_autoloader();
 
-$polyfill_autoloader = dirname(__DIR__) . '/vendor/yoast/phpunit-polyfills/phpunitpolyfills-autoload.php';
-if (file_exists($polyfill_autoloader)) {
-	require_once $polyfill_autoloader;
+if (is_dir(dirname(__DIR__) . '/vendor')
+	&& file_exists(dirname(__DIR__) . '/vendor/autoload.php')
+	&& file_exists(dirname(__DIR__) . '/vendor/yoast/phpunit-polyfills/phpunitpolyfills-autoload.php')
+) {
+	$vendor_dir = dirname(__DIR__) . '/vendor';
 } else {
-	echo 'Please run `composer install` before attempting to run the tests.', PHP_EOL;
+	echo 'Please run `composer install` before attempting to run the unit tests.
+You can still run the tests using a PHPUnit phar file, but some test dependencies need to be available.
+';
 	die(1);
 }
 
-function autoload_tests($class) {
-	if (strpos($class, 'RequestsTest_') !== 0) {
-		return;
-	}
+if (defined('__PHPUNIT_PHAR__')) {
+	// Testing via a PHPUnit phar.
 
-	$class = substr($class, 13);
-	$file  = str_replace('_', '/', $class);
-	if (file_exists(__DIR__ . '/' . $file . '.php')) {
-		require_once __DIR__ . '/' . $file . '.php';
-	}
-}
+	// Load the PHPUnit Polyfills autoloader.
+	require_once $vendor_dir . '/yoast/phpunit-polyfills/phpunitpolyfills-autoload.php';
+
+	/*
+	 * Autoloader specifically for the test files.
+	 * Fixes issues with PHPUnit not being able to find test classes being extended when running
+	 * in a non-Composer context.
+	 */
+	spl_autoload_register(
+		function ($class_name) {
+			// Only try & load our own classes.
+			if (stripos($class_name, 'Requests\\Tests\\') !== 0) {
+				return false;
+			}
 
-spl_autoload_register('autoload_tests');
+			// Strip namespace prefix 'Requests\Tests\'.
+			$relative_class = substr($class_name, 15);
+			$file           = realpath(__DIR__ . '/' . strtr($relative_class, '\\', '/') . '.php');
+
+			if (file_exists($file)) {
+				include_once $file;
+			}
+
+			return true;
+		}
+	);
+} else {
+	// Testing via a Composer setup.
+	require_once $vendor_dir . '/autoload.php';
+}
 
 function httpbin($suffix = '', $ssl = false) {
 	$host = $ssl ? 'https://' . REQUESTS_TEST_HOST_HTTPS : 'http://' . REQUESTS_TEST_HOST_HTTP;