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:
Zach Borboa
2020-02-17 13:34:53 -08:00
parent fa3cfd37d5
commit 2fd406a500
+5 -1
View File
@@ -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);
}