Skip to content

Commit

Permalink
FIxed tests based on PHP 7 or 8
Browse files Browse the repository at this point in the history
  • Loading branch information
ezimuel committed Nov 16, 2021
1 parent 3839fe4 commit f6e877c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/Client/CurlFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ public function testCreatesCurlHandle()
$result = $f($request);
$this->assertIsArray($result);
$this->assertCount(3, $result);
$this->assertInstanceOf(CurlHandle::class, $result[0]);
if (version_compare(PHP_VERSION, '8.0.0') >= 0) {
$this->assertInstanceOf(CurlHandle::class, $result[0]);
} else {
$this->assertIsResource($result[0]);
}

$this->assertIsArray($result[1]);
$this->assertSame($stream, $result[2]);
curl_close($result[0]);
Expand Down Expand Up @@ -326,8 +331,9 @@ public function testEmitsProgressToFunction()
]);
$response->wait();
$this->assertNotEmpty($called);
$num = version_compare(PHP_VERSION, '8.0.0') >= 0 ? 5 : 4;
foreach ($called as $call) {
$this->assertCount(5, $call);
$this->assertCount($num, $call);
}
}

Expand Down

0 comments on commit f6e877c

Please sign in to comment.