-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from antistatique/feature/raise-coverage
improve coverage of args[language] for Pricehubble::makeRequest
- Loading branch information
Showing
3 changed files
with
107 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
|
||
namespace Antistatique\Pricehubble\Tests\Unit; | ||
|
||
use Antistatique\Pricehubble\Pricehubble; | ||
use phpmock\phpunit\PHPMock; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
/** | ||
* @coversDefaultClass \Antistatique\Pricehubble\Pricehubble | ||
* | ||
* @group pricehubble | ||
* @group pricehubble_unit | ||
* | ||
* @internal | ||
*/ | ||
final class CurlAvailabilitiesTest extends TestCase | ||
{ | ||
use PHPMock; | ||
|
||
/** | ||
* @covers ::isCurlAvailable | ||
*/ | ||
public function testIsCurlAvailable(): void | ||
{ | ||
$pricehubble = new Pricehubble(); | ||
$this->assertTrue($pricehubble->isCurlAvailable()); | ||
} | ||
|
||
/** | ||
* @covers ::__construct | ||
* @covers ::isCurlAvailable | ||
*/ | ||
public function testcurlNotAvailable(): void | ||
{ | ||
$pricehubbleMock = $this->createMock(Pricehubble::class); | ||
$pricehubbleMock->method('isCurlAvailable')->willReturn(false); | ||
|
||
$this->expectException(\RuntimeException::class); | ||
$this->expectExceptionMessage('cURL support is required, but can\'t be found.'); | ||
$pricehubbleMock->__construct(); | ||
|
||
$pricehubbleMock->method('isCurlAvailable')->willReturn(true); | ||
} | ||
|
||
/** | ||
* @covers ::__construct | ||
* @covers ::isCurlAvailable | ||
* | ||
* @doesNotPerformAssertions | ||
*/ | ||
public function testCurlAvailable(): void | ||
{ | ||
$pricehubbleMock = $this->createMock(Pricehubble::class); | ||
$pricehubbleMock->method('isCurlAvailable')->willReturn(true); | ||
$pricehubbleMock->__construct(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters