Skip to content

Commit

Permalink
UHF-10581: phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
rpnykanen committed Oct 8, 2024
1 parent a77dabb commit 0fca085
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ public function testIndexingExceptions() {
/** @var \Drupal\helfi_google_api\JobIndexingService $indexingService */
$indexingService = $this->getSut('exception');

/** @var \Drupal\helfi_google_api\Response $response */
try {
$indexingService->indexEntity($node);
}
Expand Down Expand Up @@ -168,18 +167,18 @@ public function testDeindexing(): void {
* The job indexing service.
*/
private function getSut($errors = ''): JobIndexingService {
if ($errors != '') {
if ($errors === 'exception') {
$googleApi = $this->prophesize(GoogleApi::class);
$googleApi->isDryRun()
->willReturn(TRUE);
}

if ($errors === 'exception') {
$googleApi->indexBatch(Argument::any(), Argument::any())
->willThrow(new \Exception('Test exception'));
$googleApi = $googleApi->reveal();
}
elseif ($errors === 'errors') {
$googleApi = $this->prophesize(GoogleApi::class);
$googleApi->isDryRun()
->willReturn(TRUE);
$response = new Response(
['https://test.fi/url'],
['Unable to verify url ownership'],
Expand Down

0 comments on commit 0fca085

Please sign in to comment.