Skip to content

Commit 6b8300c

Browse files
committed
test: improve scrape tests
1 parent 9524c34 commit 6b8300c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tests/ProgramScraperTest.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,27 @@ public function testScrape(): void
2727
$mockScraper->method('scrapePrograms')
2828
->with(Carbon::create(2025, 7, 15))
2929
->willReturn([
30-
$this->testScrapeData(1),
30+
1 => $this->testScrapeData(1, 5),
31+
2 => $this->testScrapeData(2, 6),
3132
]);
3233
$scraper = new ProgramScraper($mockScraper);
3334
$programs = $scraper->scrape(Carbon::create(2025, 7, 15));
34-
$this->assertSame($this->testScrapeData(0), $programs);
35+
$this->assertSame(array_merge(
36+
$this->testScrapeData(0, 0),
37+
$this->testScrapeData(1, 0)
38+
), $programs);
3539
}
3640

3741
/**
3842
* @psalm-param int $keyIndex
43+
* @psalm-param int $boatKeyIndex
3944
* @psalm-return ScrapedStadiumRaces
4045
*
4146
* @param int $keyIndex
47+
* @param int $boatKeyIndex
4248
* @return array
4349
*/
44-
private function testScrapeData(int $keyIndex): array
50+
private function testScrapeData(int $keyIndex, int $boatKeyIndex): array
4551
{
4652
return [
4753
$keyIndex => [
@@ -54,7 +60,7 @@ private function testScrapeData(int $keyIndex): array
5460
'race_subtitle' => '予選',
5561
'race_distance' => 1800,
5662
'boats' => [
57-
$keyIndex => [
63+
$boatKeyIndex => [
5864
'racer_boat_number' => 1,
5965
'racer_name' => '松本 浩貴',
6066
'racer_number' => 3860,

0 commit comments

Comments
 (0)