Skip to content

Commit fa53900

Browse files
committed
refactor: use assertCount()
1 parent 0c0632a commit fa53900

7 files changed

Lines changed: 8 additions & 8 deletions

File tree

tests/Feature/AnalyticsRulesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ public function testCanDeleteARule(): void
5252
public function testCanRetrieveAllRules(): void
5353
{
5454
$returnData = $this->client()->analytics->rules()->retrieve();
55-
$this->assertEquals(count($returnData['rules']), 1);
55+
$this->assertCount(1, $returnData['rules']);
5656
}
5757
}

tests/Feature/CollectionsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ public function testCanDeleteACollection(): void
5858
public function testCanRetrieveAllCollections(): void
5959
{
6060
$response = $this->client()->collections->retrieve();
61-
$this->assertEquals(1, count($response));
61+
$this->assertCount(1, $response);
6262
}
6363
}

tests/Feature/MultiSearchTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected function setUp(): void
3333
public function testCanPerformAMultiSearch(): void
3434
{
3535
$returnData = $this->client()->multiSearch->perform($this->searchRequests, $this->commonSearchParams);
36-
$this->assertEquals(2, count($returnData['results']));
36+
$this->assertCount(2, $returnData['results']);
3737
}
3838

3939
public function testCanLimitNumberOfRequestsInOneMultiSearch(): void

tests/Feature/OverridesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ public function testCanDeleteAnOverride(): void
5757
public function testCanRetrieveAllOverrides(): void
5858
{
5959
$returnData = $this->client()->collections['books']->overrides->retrieve();
60-
$this->assertEquals(1, count($returnData['overrides']));
60+
$this->assertCount(1, $returnData['overrides']);
6161
}
6262
}

tests/Feature/PresetsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ public function testCanDeleteAPreset(): void
5151
$this->assertEquals($this->presetName, $returnData['name']);
5252

5353
$returnPresets = $this->client()->presets->get();
54-
$this->assertEquals(0, count($returnPresets['presets']));
54+
$this->assertCount(0, $returnPresets['presets']);
5555
}
5656

5757
public function testCanRetrieveAllPresets(): void
5858
{
5959
$returnData = $this->client()->presets->get();
60-
$this->assertEquals(1, count($returnData['presets']));
60+
$this->assertCount(1, $returnData['presets']);
6161
}
6262
}

tests/Feature/StopwordsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ public function testCanDeleteAStopword(): void
5454
public function testCanRetrieveAllStopwords(): void
5555
{
5656
$returnData = $this->client()->stopwords->getAll();
57-
$this->assertEquals(1, count($returnData['stopwords']));
57+
$this->assertCount(1, $returnData['stopwords']);
5858
}
5959
}

tests/Feature/SynonymsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ public function testCanDeleteASynonymById(): void
4747
public function testCanRetrieveAllSynonyms(): void
4848
{
4949
$returnData = $this->synonyms->retrieve();
50-
$this->assertEquals(1, count($returnData['synonyms']));
50+
$this->assertCount(1, $returnData['synonyms']);
5151
}
5252
}

0 commit comments

Comments
 (0)