mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-09-03 14:27:59 +00:00
Fix continuous integration tests for PHP 7.3.
There were 3 errors:
1) CurlTest\CurlTest::testMultipartFormDataContentType
TypeError: Argument 2 passed to PHPUnit\Framework\Assert::assertContains() must be iterable, string given, [...]
2) CurlTest\CurlTest::testJsonEncode
ErrorException: json_encode error: Malformed UTF-8 characters, possibly incorrectly encoded
3) CurlTest\CurlTest::testRequiredOptionCurlOptReturnTransferEmitsWarning
CURLOPT_RETURNTRANSFER is a required option
This commit is contained in:
@@ -587,7 +587,7 @@ class CurlTest extends \PHPUnit\Framework\TestCase
|
||||
"\r\n" .
|
||||
'bar' . "\r\n" .
|
||||
'';
|
||||
$this->assertContains($expected_contains, $test->curl->response);
|
||||
$this->assertStringContainsString($expected_contains, $test->curl->response);
|
||||
}
|
||||
|
||||
public function testPatchRequestMethod()
|
||||
@@ -1456,6 +1456,8 @@ class CurlTest extends \PHPUnit\Framework\TestCase
|
||||
*/
|
||||
public function testJsonEncode()
|
||||
{
|
||||
$this->expectException(\ErrorException::class);
|
||||
|
||||
$data = array(
|
||||
'malformed' => pack('H*', 'c32e'),
|
||||
);
|
||||
@@ -3031,6 +3033,8 @@ class CurlTest extends \PHPUnit\Framework\TestCase
|
||||
*/
|
||||
public function testRequiredOptionCurlOptReturnTransferEmitsWarning()
|
||||
{
|
||||
$this->expectWarning(\PHPUnit\Framework\Error\Warning::class);
|
||||
|
||||
$curl = new Curl();
|
||||
$curl->setOpt(CURLOPT_RETURNTRANSFER, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user