Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
aivchen committed Jan 21, 2024
1 parent 4810abd commit 5109ea5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/Endpoints/DocumentsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,20 +319,19 @@ public function testAddDocumentsCsvInBatchesWithDelimiter(): void

$index->expects($matcher)
->method('addDocumentsCsv')
->willReturnCallback(function (string $param) use ($matcher): void {
->willReturnCallback(function (string $documents, $primaryKey, $delimiter) use ($matcher): void {
// withConsecutive has no replacement https://github.com/sebastianbergmann/phpunit/issues/4026
switch ($matcher->numberOfInvocations()) {
case 1:
$this->assertEquals($param, ["id;title\n888221515;Young folks", null, ';']);
static::assertSame(["id;title\n888221515;Young folks", null, ';'], [$documents, $primaryKey, $delimiter]);
break;
case 2:
$this->assertEquals($param, ["id;title\n235115704;Mister Klein", null, ';']);
static::assertSame(["id;title\n235115704;Mister Klein", null, ';'], [$documents, $primaryKey, $delimiter]);
break;
default:
self::fail();
}
})
->willReturn([], []);
});

$index->addDocumentsCsvInBatches($documentCsv, 1, null, ';');
}
Expand Down

0 comments on commit 5109ea5

Please sign in to comment.