From 6ce3513794de8ee879ef178d0356b6c87aa2ca7a Mon Sep 17 00:00:00 2001 From: webeweb Date: Mon, 6 Feb 2023 17:12:52 +0100 Subject: [PATCH] Improve unit tests --- tests/Response/BreachesResponseTest.php | 3 +++ tests/Response/DataClassesResponseTest.php | 3 +++ tests/Response/PastesResponseTest.php | 3 +++ tests/Response/RangesResponseTest.php | 3 +++ 4 files changed, 12 insertions(+) diff --git a/tests/Response/BreachesResponseTest.php b/tests/Response/BreachesResponseTest.php index 30975e0..fbbbc05 100644 --- a/tests/Response/BreachesResponseTest.php +++ b/tests/Response/BreachesResponseTest.php @@ -12,6 +12,7 @@ namespace WBW\Library\HaveIBeenPwned\Tests\Response; use WBW\Library\HaveIBeenPwned\Model\Breach; +use WBW\Library\HaveIBeenPwned\Response\AbstractResponse; use WBW\Library\HaveIBeenPwned\Response\BreachesResponse; use WBW\Library\HaveIBeenPwned\Tests\AbstractTestCase; @@ -50,6 +51,8 @@ public function test__construct(): void { $obj = new BreachesResponse(); + $this->assertInstanceOf(AbstractResponse::class, $obj); + $this->assertCount(0, $obj->getBreaches()); } } diff --git a/tests/Response/DataClassesResponseTest.php b/tests/Response/DataClassesResponseTest.php index af13ad0..2fa75fe 100644 --- a/tests/Response/DataClassesResponseTest.php +++ b/tests/Response/DataClassesResponseTest.php @@ -12,6 +12,7 @@ namespace WBW\Library\HaveIBeenPwned\Tests\Response; use WBW\Library\HaveIBeenPwned\Model\DataClass; +use WBW\Library\HaveIBeenPwned\Response\AbstractResponse; use WBW\Library\HaveIBeenPwned\Response\DataClassesResponse; use WBW\Library\HaveIBeenPwned\Tests\AbstractTestCase; @@ -50,6 +51,8 @@ public function test__construct(): void { $obj = new DataClassesResponse(); + $this->assertInstanceOf(AbstractResponse::class, $obj); + $this->assertCount(0, $obj->getDataClasses()); } } diff --git a/tests/Response/PastesResponseTest.php b/tests/Response/PastesResponseTest.php index 029b35e..66e87a1 100644 --- a/tests/Response/PastesResponseTest.php +++ b/tests/Response/PastesResponseTest.php @@ -12,6 +12,7 @@ namespace WBW\Library\HaveIBeenPwned\Tests\Response; use WBW\Library\HaveIBeenPwned\Model\Paste; +use WBW\Library\HaveIBeenPwned\Response\AbstractResponse; use WBW\Library\HaveIBeenPwned\Response\PastesResponse; use WBW\Library\HaveIBeenPwned\Tests\AbstractTestCase; @@ -50,6 +51,8 @@ public function test__construct(): void { $obj = new PastesResponse(); + $this->assertInstanceOf(AbstractResponse::class, $obj); + $this->assertCount(0, $obj->getPastes()); } } diff --git a/tests/Response/RangesResponseTest.php b/tests/Response/RangesResponseTest.php index 9e65f5f..92ea994 100644 --- a/tests/Response/RangesResponseTest.php +++ b/tests/Response/RangesResponseTest.php @@ -12,6 +12,7 @@ namespace WBW\Library\HaveIBeenPwned\Tests\Response; use WBW\Library\HaveIBeenPwned\Model\Range; +use WBW\Library\HaveIBeenPwned\Response\AbstractResponse; use WBW\Library\HaveIBeenPwned\Response\RangesResponse; use WBW\Library\HaveIBeenPwned\Tests\AbstractTestCase; @@ -50,6 +51,8 @@ public function test__construct(): void { $obj = new RangesResponse(); + $this->assertInstanceOf(AbstractResponse::class, $obj); + $this->assertCount(0, $obj->getRanges()); } }