Skip to content

Commit e1a2da4

Browse files
authored
Merge pull request php-curl-class#431 from zachborboa/master
Fix new version of PHPUnit causing build to break
2 parents c86e86d + d9b5e3e commit e1a2da4

File tree

4 files changed

+619
-588
lines changed

4 files changed

+619
-588
lines changed

tests/PHPCurlClass/Helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ private function chained_request($request_method)
4040
} else {
4141
$this->server('request_method', $request_method);
4242
}
43-
\PHPUnit_Framework_Assert::assertEquals($request_method, $this->curl->responseHeaders['X-REQUEST-METHOD']);
43+
\PHPUnit\Framework\Assert::assertEquals($request_method, $this->curl->responseHeaders['X-REQUEST-METHOD']);
4444
}
4545

4646
public function chain_requests($first, $second)

tests/PHPCurlClass/PHPCurlClassTest.php

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use \Curl\CaseInsensitiveArray;
55
use \Helper\Test;
66

7-
class CurlTest extends PHPUnit_Framework_TestCase
7+
class CurlTest extends \PHPUnit\Framework\TestCase
88
{
99
public function testExtensionsLoaded()
1010
{
@@ -653,13 +653,13 @@ public function testDownloadCallback()
653653
$curl->download(Test::TEST_URL . '?' . http_build_query(array(
654654
'file_path' => $uploaded_file_path,
655655
)), function ($instance, $fh) use (&$callback_called) {
656-
PHPUnit_Framework_Assert::assertFalse($callback_called);
657-
PHPUnit_Framework_Assert::assertInstanceOf('Curl\Curl', $instance);
658-
PHPUnit_Framework_Assert::assertTrue(is_resource($fh));
659-
PHPUnit_Framework_Assert::assertEquals('stream', get_resource_type($fh));
660-
PHPUnit_Framework_Assert::assertGreaterThan(0, strlen(stream_get_contents($fh)));
661-
PHPUnit_Framework_Assert::assertEquals(0, strlen(stream_get_contents($fh)));
662-
PHPUnit_Framework_Assert::assertTrue(fclose($fh));
656+
\PHPUnit\Framework\Assert::assertFalse($callback_called);
657+
\PHPUnit\Framework\Assert::assertInstanceOf('Curl\Curl', $instance);
658+
\PHPUnit\Framework\Assert::assertTrue(is_resource($fh));
659+
\PHPUnit\Framework\Assert::assertEquals('stream', get_resource_type($fh));
660+
\PHPUnit\Framework\Assert::assertGreaterThan(0, strlen(stream_get_contents($fh)));
661+
\PHPUnit\Framework\Assert::assertEquals(0, strlen(stream_get_contents($fh)));
662+
\PHPUnit\Framework\Assert::assertTrue(fclose($fh));
663663
$callback_called = true;
664664
});
665665
$this->assertTrue($callback_called);
@@ -2671,11 +2671,11 @@ public function testSuccessCallback()
26712671
&$error_called,
26722672
&$complete_called
26732673
) {
2674-
PHPUnit_Framework_Assert::assertInstanceOf('Curl\Curl', $instance);
2675-
PHPUnit_Framework_Assert::assertFalse($before_send_called);
2676-
PHPUnit_Framework_Assert::assertFalse($success_called);
2677-
PHPUnit_Framework_Assert::assertFalse($error_called);
2678-
PHPUnit_Framework_Assert::assertFalse($complete_called);
2674+
\PHPUnit\Framework\Assert::assertInstanceOf('Curl\Curl', $instance);
2675+
\PHPUnit\Framework\Assert::assertFalse($before_send_called);
2676+
\PHPUnit\Framework\Assert::assertFalse($success_called);
2677+
\PHPUnit\Framework\Assert::assertFalse($error_called);
2678+
\PHPUnit\Framework\Assert::assertFalse($complete_called);
26792679
$before_send_called = true;
26802680
});
26812681
$curl->success(function ($instance) use (
@@ -2684,11 +2684,11 @@ public function testSuccessCallback()
26842684
&$error_called,
26852685
&$complete_called
26862686
) {
2687-
PHPUnit_Framework_Assert::assertInstanceOf('Curl\Curl', $instance);
2688-
PHPUnit_Framework_Assert::assertTrue($before_send_called);
2689-
PHPUnit_Framework_Assert::assertFalse($success_called);
2690-
PHPUnit_Framework_Assert::assertFalse($error_called);
2691-
PHPUnit_Framework_Assert::assertFalse($complete_called);
2687+
\PHPUnit\Framework\Assert::assertInstanceOf('Curl\Curl', $instance);
2688+
\PHPUnit\Framework\Assert::assertTrue($before_send_called);
2689+
\PHPUnit\Framework\Assert::assertFalse($success_called);
2690+
\PHPUnit\Framework\Assert::assertFalse($error_called);
2691+
\PHPUnit\Framework\Assert::assertFalse($complete_called);
26922692
$success_called = true;
26932693
});
26942694
$curl->error(function ($instance) use (
@@ -2705,11 +2705,11 @@ public function testSuccessCallback()
27052705
&$error_called,
27062706
&$complete_called
27072707
) {
2708-
PHPUnit_Framework_Assert::assertInstanceOf('Curl\Curl', $instance);
2709-
PHPUnit_Framework_Assert::assertTrue($before_send_called);
2710-
PHPUnit_Framework_Assert::assertTrue($success_called);
2711-
PHPUnit_Framework_Assert::assertFalse($error_called);
2712-
PHPUnit_Framework_Assert::assertFalse($complete_called);
2708+
\PHPUnit\Framework\Assert::assertInstanceOf('Curl\Curl', $instance);
2709+
\PHPUnit\Framework\Assert::assertTrue($before_send_called);
2710+
\PHPUnit\Framework\Assert::assertTrue($success_called);
2711+
\PHPUnit\Framework\Assert::assertFalse($error_called);
2712+
\PHPUnit\Framework\Assert::assertFalse($complete_called);
27132713
$complete_called = true;
27142714
});
27152715

@@ -2738,11 +2738,11 @@ public function testErrorCallback()
27382738
&$error_called,
27392739
&$complete_called
27402740
) {
2741-
PHPUnit_Framework_Assert::assertInstanceOf('Curl\Curl', $instance);
2742-
PHPUnit_Framework_Assert::assertFalse($before_send_called);
2743-
PHPUnit_Framework_Assert::assertFalse($success_called);
2744-
PHPUnit_Framework_Assert::assertFalse($error_called);
2745-
PHPUnit_Framework_Assert::assertFalse($complete_called);
2741+
\PHPUnit\Framework\Assert::assertInstanceOf('Curl\Curl', $instance);
2742+
\PHPUnit\Framework\Assert::assertFalse($before_send_called);
2743+
\PHPUnit\Framework\Assert::assertFalse($success_called);
2744+
\PHPUnit\Framework\Assert::assertFalse($error_called);
2745+
\PHPUnit\Framework\Assert::assertFalse($complete_called);
27462746
$before_send_called = true;
27472747
});
27482748
$curl->success(function ($instance) use (
@@ -2759,11 +2759,11 @@ public function testErrorCallback()
27592759
&$error_called,
27602760
&$complete_called
27612761
) {
2762-
PHPUnit_Framework_Assert::assertInstanceOf('Curl\Curl', $instance);
2763-
PHPUnit_Framework_Assert::assertTrue($before_send_called);
2764-
PHPUnit_Framework_Assert::assertFalse($success_called);
2765-
PHPUnit_Framework_Assert::assertFalse($error_called);
2766-
PHPUnit_Framework_Assert::assertFalse($complete_called);
2762+
\PHPUnit\Framework\Assert::assertInstanceOf('Curl\Curl', $instance);
2763+
\PHPUnit\Framework\Assert::assertTrue($before_send_called);
2764+
\PHPUnit\Framework\Assert::assertFalse($success_called);
2765+
\PHPUnit\Framework\Assert::assertFalse($error_called);
2766+
\PHPUnit\Framework\Assert::assertFalse($complete_called);
27672767
$error_called = true;
27682768
});
27692769
$curl->complete(function ($instance) use (
@@ -2772,11 +2772,11 @@ public function testErrorCallback()
27722772
&$error_called,
27732773
&$complete_called
27742774
) {
2775-
PHPUnit_Framework_Assert::assertInstanceOf('Curl\Curl', $instance);
2776-
PHPUnit_Framework_Assert::assertTrue($before_send_called);
2777-
PHPUnit_Framework_Assert::assertFalse($success_called);
2778-
PHPUnit_Framework_Assert::assertTrue($error_called);
2779-
PHPUnit_Framework_Assert::assertFalse($complete_called);
2775+
\PHPUnit\Framework\Assert::assertInstanceOf('Curl\Curl', $instance);
2776+
\PHPUnit\Framework\Assert::assertTrue($before_send_called);
2777+
\PHPUnit\Framework\Assert::assertFalse($success_called);
2778+
\PHPUnit\Framework\Assert::assertTrue($error_called);
2779+
\PHPUnit\Framework\Assert::assertFalse($complete_called);
27802780
$complete_called = true;
27812781
});
27822782

@@ -2800,7 +2800,7 @@ public function testClose()
28002800
}
28012801

28022802
/**
2803-
* @expectedException PHPUnit_Framework_Error_Warning
2803+
* @expectedException \PHPUnit\Framework\Error\Warning
28042804
*/
28052805
public function testRequiredOptionCurlOptReturnTransferEmitsWarning()
28062806
{

0 commit comments

Comments
 (0)