fix to deprecated method + more tests
This commit is contained in:
@@ -71,13 +71,21 @@ class UnirestRequestTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(true, $args->gzipped);
|
||||
}
|
||||
|
||||
public function testBasicAuthentication()
|
||||
public function testBasicAuthenticationDeprecated()
|
||||
{
|
||||
$response = Unirest\Request::get('http://httpbin.org/get', array(), array(), 'user', 'password');
|
||||
$headers = $response->body->headers;
|
||||
$this->assertEquals('Basic dXNlcjpwYXNzd29yZA==', $headers->Authorization);
|
||||
}
|
||||
|
||||
public function testBasicAuthentication()
|
||||
{
|
||||
Unirest\Request::auth('user', 'password');
|
||||
$response = Unirest\Request::get('http://httpbin.org/get');
|
||||
|
||||
$this->assertEquals('Basic dXNlcjpwYXNzd29yZA==', $response->body->headers->Authorization);
|
||||
}
|
||||
|
||||
public function testCustomHeaders()
|
||||
{
|
||||
$response = Unirest\Request::get('http://httpbin.org/get', array(
|
||||
|
||||
Reference in New Issue
Block a user