Skip to content

Commit

Permalink
#98 fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
guich25 committed Feb 28, 2024
1 parent 318245b commit a4f7ecb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public function testQuery(QueryBuilder $queryBuilder, array $expectedCouples): v
$this->loadFixtures($storage);

self::assertExecutions($expectedCouples, $storage->query($queryBuilder->getQuery()));
self::assertSame(\count($expectedCouples[0]), $storage->count($queryBuilder->getQuery()));
self::assertSame(\count($expectedCouples), $storage->count($queryBuilder->getQuery()));
}

public function queries(): Generator
Expand Down
5 changes: 3 additions & 2 deletions src/batch/tests/Storage/FilesystemJobExecutionStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,16 @@ public function list(): \Generator
/**
* @dataProvider query
*/
public function testQueryWithProvider(QueryBuilder $query, array $expectedCouples): void
public function testQueryWithProvider(QueryBuilder $query, array $expectedCouples, ?int $expectedCount = null): void
{
$storage = $this->createStorage(
__DIR__ . '/fixtures/filesystem-job-execution',
new JsonJobExecutionSerializer()
);

self::assertExecutions($expectedCouples, $storage->query($query->getQuery()));
self::assertEquals(\count($expectedCouples), $storage->count($query->getQuery()));
$expectedCount ??= count($expectedCouples);
self::assertEquals($expectedCount, $storage->count($query->getQuery()));
}

public function query(): \Generator
Expand Down

0 comments on commit a4f7ecb

Please sign in to comment.