From c9d21466aa1b513720d04e407ec3ac4426b7f363 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Tue, 21 Nov 2017 17:50:28 +0100 Subject: [PATCH] assertCount should be used instead --- tests/Auth/APIKeyTest.php | 2 +- tests/Auth/UserServiceKeyTest.php | 2 +- tests/Configurations/ConfigurationsUARulesTest.php | 2 +- tests/Configurations/ConfigurationsZoneLockdownTest.php | 4 ++-- tests/Configurations/PageRulesTargetTest.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/Auth/APIKeyTest.php b/tests/Auth/APIKeyTest.php index 6e7768b..10a788b 100644 --- a/tests/Auth/APIKeyTest.php +++ b/tests/Auth/APIKeyTest.php @@ -18,6 +18,6 @@ class APIKeyTest extends TestCase $this->assertEquals('example@example.com', $headers['X-Auth-Email']); $this->assertEquals('1234567893feefc5f0q5000bfo0c38d90bbeb', $headers['X-Auth-Key']); - $this->assertEquals(2, count($headers)); + $this->assertCount(2, $headers); } } diff --git a/tests/Auth/UserServiceKeyTest.php b/tests/Auth/UserServiceKeyTest.php index f746785..53e29b3 100644 --- a/tests/Auth/UserServiceKeyTest.php +++ b/tests/Auth/UserServiceKeyTest.php @@ -19,6 +19,6 @@ class UserServiceKeyTest extends TestCase $headers['X-Auth-User-Service-Key'] ); - $this->assertEquals(1, count($headers)); + $this->assertCount(1, $headers); } } diff --git a/tests/Configurations/ConfigurationsUARulesTest.php b/tests/Configurations/ConfigurationsUARulesTest.php index a2fe0a1..aeecbf5 100644 --- a/tests/Configurations/ConfigurationsUARulesTest.php +++ b/tests/Configurations/ConfigurationsUARulesTest.php @@ -14,7 +14,7 @@ class ConfigurationsUARulesTest extends TestCase $configuration->addUA('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/603.2.4 (KHTML, like Gecko) Version/10.1.1 Safari/603.2.4'); $array = $configuration->getArray(); - $this->assertEquals(1, count($array)); + $this->assertCount(1, $array); $this->assertObjectHasAttribute('target', $array[0]); $this->assertEquals('ua', $array[0]->target); diff --git a/tests/Configurations/ConfigurationsZoneLockdownTest.php b/tests/Configurations/ConfigurationsZoneLockdownTest.php index b110cd7..e4282cc 100644 --- a/tests/Configurations/ConfigurationsZoneLockdownTest.php +++ b/tests/Configurations/ConfigurationsZoneLockdownTest.php @@ -14,7 +14,7 @@ class ConfigurationsZoneLockdownTest extends TestCase $configuration->addIP('1.2.3.4'); $array = $configuration->getArray(); - $this->assertEquals(1, count($array)); + $this->assertCount(1, $array); $this->assertObjectHasAttribute('target', $array[0]); $this->assertEquals('ip', $array[0]->target); @@ -24,7 +24,7 @@ class ConfigurationsZoneLockdownTest extends TestCase $configuration->addIPRange('1.2.3.4/24'); $array = $configuration->getArray(); - $this->assertEquals(2, count($array)); + $this->assertCount(2, $array); $this->assertObjectHasAttribute('target', $array[1]); $this->assertEquals('ip_range', $array[1]->target); diff --git a/tests/Configurations/PageRulesTargetTest.php b/tests/Configurations/PageRulesTargetTest.php index fcf2a51..a3b563a 100644 --- a/tests/Configurations/PageRulesTargetTest.php +++ b/tests/Configurations/PageRulesTargetTest.php @@ -15,7 +15,7 @@ class PageRulesTargetTest extends TestCase $targets = new PageRulesTargets('junade.com/*'); $array = $targets->getArray(); - $this->assertEquals(1, count($array)); + $this->assertCount(1, $array); $this->assertEquals('junade.com/*', $array[0]->constraint->value); $this->assertEquals('matches', $array[0]->constraint->operator); }