Skip to content
This repository was archived by the owner on Dec 22, 2025. It is now read-only.

Commit 7b36a2a

Browse files
authored
Merge pull request #19 from open-source-contributions/test_enhancement
Improve PHPUnit assertions
2 parents 922d1b3 + 545a0f8 commit 7b36a2a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/Client/MemoryTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function testGetTimers()
5151
$timer2->finish($metric2);
5252

5353
$timers = $statsClient->getTimers();
54-
$this->assertEquals(2, count($timers));
54+
$this->assertCount(2, $timers);
5555

5656
$this->assertEquals($timer1, $timers[0]);
5757
$this->assertEquals($timer2, $timers[1]);
@@ -89,10 +89,10 @@ public function testGetIncrementedMetrics()
8989
$statsClient->trackMetric($section2, new Bucket\MetricOperation([$operation2]), $timer22, $n22);
9090

9191
$timers = $statsClient->getTimers();
92-
$this->assertEquals(4, count($timers));
92+
$this->assertCount(4, $timers);
9393

9494
$metrics = $statsClient->getIncrementedMetrics();
95-
$this->assertEquals(4, count($metrics));
95+
$this->assertCount(4, $metrics);
9696

9797
$this->assertArrayHasKey($metric1, $metrics);
9898
$this->assertEquals($n11 + $n12, $metrics[$metric1]);
@@ -125,7 +125,7 @@ public function testGetStateMetrics()
125125
$statsClient->trackState($section2, new Bucket\MetricOperation([$operation2]), $n22);
126126

127127
$states = $statsClient->getStateMetrics();
128-
$this->assertEquals(2, count($states));
128+
$this->assertCount(2, $states);
129129

130130
$this->assertArrayHasKey($metric1, $states);
131131
$this->assertEquals($n12, $states[$metric1]);

0 commit comments

Comments
 (0)