mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-26 22:59:57 +09:00
Update composer dependencies
This commit is contained in:
parent
49cc39e507
commit
cbd324c35b
428 changed files with 17862 additions and 5885 deletions
33
vendor/rmccue/requests/tests/bootstrap.php
vendored
Executable file → Normal file
33
vendor/rmccue/requests/tests/bootstrap.php
vendored
Executable file → Normal file
|
|
@ -1,5 +1,26 @@
|
|||
<?php
|
||||
|
||||
date_default_timezone_set('UTC');
|
||||
|
||||
function define_from_env($name, $default = false) {
|
||||
$env = getenv($name);
|
||||
if ($env) {
|
||||
define($name, $env);
|
||||
}
|
||||
else {
|
||||
define($name, $default);
|
||||
}
|
||||
}
|
||||
|
||||
define_from_env('REQUESTS_TEST_HOST', 'requests-php-tests.herokuapp.com');
|
||||
define_from_env('REQUESTS_TEST_HOST_HTTP', REQUESTS_TEST_HOST);
|
||||
define_from_env('REQUESTS_TEST_HOST_HTTPS', REQUESTS_TEST_HOST);
|
||||
|
||||
define_from_env('REQUESTS_HTTP_PROXY');
|
||||
define_from_env('REQUESTS_HTTP_PROXY_AUTH');
|
||||
define_from_env('REQUESTS_HTTP_PROXY_AUTH_USER');
|
||||
define_from_env('REQUESTS_HTTP_PROXY_AUTH_PASS');
|
||||
|
||||
include(dirname(dirname(__FILE__)) . '/library/Requests.php');
|
||||
Requests::register_autoloader();
|
||||
|
||||
|
|
@ -17,6 +38,11 @@ function autoload_tests($class) {
|
|||
|
||||
spl_autoload_register('autoload_tests');
|
||||
|
||||
function httpbin($suffix = '', $ssl = false) {
|
||||
$host = $ssl ? 'https://' . REQUESTS_TEST_HOST_HTTPS : 'http://' . REQUESTS_TEST_HOST_HTTP;
|
||||
return rtrim( $host, '/' ) . '/' . ltrim( $suffix, '/' );
|
||||
}
|
||||
|
||||
class MockTransport implements Requests_Transport {
|
||||
public $code = 200;
|
||||
public $chunked = false;
|
||||
|
|
@ -59,16 +85,21 @@ class MockTransport implements Requests_Transport {
|
|||
415 => '415 Unsupported Media Type',
|
||||
416 => '416 Requested Range Not Satisfiable',
|
||||
417 => '417 Expectation Failed',
|
||||
418 => '418 I\'m a teapot',
|
||||
428 => '428 Precondition Required',
|
||||
429 => '429 Too Many Requests',
|
||||
431 => '431 Request Header Fields Too Large',
|
||||
500 => '500 Internal Server Error',
|
||||
501 => '501 Not Implemented',
|
||||
502 => '502 Bad Gateway',
|
||||
503 => '503 Service Unavailable',
|
||||
504 => '504 Gateway Timeout',
|
||||
505 => '505 HTTP Version Not Supported',
|
||||
511 => '511 Network Authentication Required',
|
||||
);
|
||||
|
||||
public function request($url, $headers = array(), $data = array(), $options = array()) {
|
||||
$status = self::$messages[$this->code];
|
||||
$status = isset(self::$messages[$this->code]) ? self::$messages[$this->code] : $this->code . ' unknown';
|
||||
$response = "HTTP/1.0 $status\r\n";
|
||||
$response .= "Content-Type: text/plain\r\n";
|
||||
if ($this->chunked) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue