mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-30 12:14:36 +00:00
Simplify test for Curl::reset()
This commit is contained in:
@@ -219,6 +219,7 @@ Curl::post($url, $data = '', $follow_303_with_post = false)
|
||||
Curl::progress($callback)
|
||||
Curl::put($url, $data = array())
|
||||
Curl::removeHeader($key)
|
||||
Curl::reset()
|
||||
Curl::search($url, $data = array())
|
||||
Curl::setBasicAuthentication($username, $password = '')
|
||||
Curl::setConnectTimeout($seconds)
|
||||
|
||||
@@ -1493,7 +1493,6 @@ class Curl
|
||||
*
|
||||
* @access private
|
||||
* @param $base_url
|
||||
* @throws \ErrorException
|
||||
*/
|
||||
private function initialize($base_url = null)
|
||||
{
|
||||
|
||||
@@ -3642,12 +3642,10 @@ class CurlTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
public function testReset()
|
||||
{
|
||||
$php_version = preg_replace('/([\.\+\?\*\(\)\[\]\^\$\/])/', '\\\\\1', 'PHP/' . PHP_VERSION);
|
||||
|
||||
$test = new Test();
|
||||
|
||||
$user_agent = $test->server('server', 'GET', array('key' => 'HTTP_USER_AGENT'));
|
||||
$this->assertRegExp('/' . $php_version . '/', $user_agent);
|
||||
$original_user_agent = $test->server('server', 'GET', array('key' => 'HTTP_USER_AGENT'));
|
||||
$this->assertNotEquals('New agent', $original_user_agent);
|
||||
|
||||
$test->curl->setUserAgent('New agent');
|
||||
$user_agent = $test->server('server', 'GET', array('key' => 'HTTP_USER_AGENT'));
|
||||
@@ -3655,6 +3653,6 @@ class CurlTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
$test->curl->reset();
|
||||
$user_agent = $test->server('server', 'GET', array('key' => 'HTTP_USER_AGENT'));
|
||||
$this->assertRegExp('/' . $php_version . '/', $user_agent);
|
||||
$this->assertEquals($original_user_agent, $user_agent);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user