test(github): exercise startFetch()/resolveFetch() instead of fetch()
This commit is contained in:
@@ -96,7 +96,8 @@ final class GitHubProviderTest extends TestCase
|
|||||||
]],
|
]],
|
||||||
]));
|
]));
|
||||||
|
|
||||||
$result = $this->makeProvider(client: $client)->fetch();
|
$provider = $this->makeProvider(client: $client);
|
||||||
|
$result = $provider->resolveFetch($provider->startFetch());
|
||||||
|
|
||||||
$this->assertSame(4, $result['2024-06-10']);
|
$this->assertSame(4, $result['2024-06-10']);
|
||||||
$this->assertSame(2, $result['2024-06-11']);
|
$this->assertSame(2, $result['2024-06-11']);
|
||||||
@@ -112,7 +113,8 @@ final class GitHubProviderTest extends TestCase
|
|||||||
]],
|
]],
|
||||||
]));
|
]));
|
||||||
|
|
||||||
$result = $this->makeProvider(client: $client)->fetch();
|
$provider = $this->makeProvider(client: $client);
|
||||||
|
$result = $provider->resolveFetch($provider->startFetch());
|
||||||
|
|
||||||
$this->assertArrayNotHasKey('2024-06-11', $result);
|
$this->assertArrayNotHasKey('2024-06-11', $result);
|
||||||
}
|
}
|
||||||
@@ -130,7 +132,8 @@ final class GitHubProviderTest extends TestCase
|
|||||||
|
|
||||||
$this->expectException(ServiceUnavailableHttpException::class);
|
$this->expectException(ServiceUnavailableHttpException::class);
|
||||||
|
|
||||||
$this->makeProvider(client: $client)->fetch();
|
$provider = $this->makeProvider(client: $client);
|
||||||
|
$provider->resolveFetch($provider->startFetch());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Test]
|
#[Test]
|
||||||
@@ -139,7 +142,8 @@ final class GitHubProviderTest extends TestCase
|
|||||||
$client = $this->createStub(HttpClientInterface::class);
|
$client = $this->createStub(HttpClientInterface::class);
|
||||||
$client->method('request')->willReturn($this->stubGraphqlResponse([]));
|
$client->method('request')->willReturn($this->stubGraphqlResponse([]));
|
||||||
|
|
||||||
$result = $this->makeProvider(client: $client)->fetch();
|
$provider = $this->makeProvider(client: $client);
|
||||||
|
$result = $provider->resolveFetch($provider->startFetch());
|
||||||
|
|
||||||
$this->assertSame([], $result);
|
$this->assertSame([], $result);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user