Skip to content

Commit

Permalink
Refactor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zoonman committed Jun 26, 2023
1 parent 405cda0 commit 1f6ac4f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"ext-json": "*"
},
"require-dev": {
"phpunit/phpunit": "^4.8|^5.5|^6.5|^7.0.0|^8.0.0|^9.0.0|^10.0.0"
"phpunit/phpunit": "^7.0.0|^8.0.0|^9.0.0|^10.0.0"
},
"autoload": {
"psr-4": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,33 @@ public function setUp(): void

/**
* Run tests
* @expectedException \Exception
* @expectedExceptionMessage You must specify "key" parameter in constructor options
*/
*
*
*/
public function testConstructorOnNoKeyParameter()
{
$this->expectException(\Exception::class);
$this->expectExceptionMessage("You must specify \"key\" parameter in constructor options");
$this->object = new PixabayClient([]);
}

/**
* Run tests
* @expectedException GuzzleHttp\Exception\ClientException
*
*/
public function testGetImages()
{
$this->assertInternalType('array', $this->object->getImages(['q' => 'test']));
$this->expectException(\GuzzleHttp\Exception\ClientException::class);
$this->assertIsArray($this->object->getImages(['q' => 'test']));
}

/**
* Run tests
* @expectedException GuzzleHttp\Exception\ClientException
*
*/
public function testGetVideos()
{
$this->assertInternalType('array', $this->object->getVideos(['q' => 'test']));
$this->expectException(\GuzzleHttp\Exception\ClientException::class);
$this->assertIsArray($this->object->getVideos(['q' => 'test']));
}
}

0 comments on commit 1f6ac4f

Please sign in to comment.