You are here

public function AssetRefreshManagerTest::testFailedApiRequest in Media: Acquia DAM 8

Tests a "failed API request" scenario.

@dataProvider providerTestFailedApiRequest

Parameters

\Throwable $exception_stub: Exception object stub.

File

tests/src/Unit/AssetRefreshManagerTest.php, line 264

Class

AssetRefreshManagerTest
AssetRefreshManager Service test.

Namespace

Drupal\Tests\media_acquiadam\Unit

Code

public function testFailedApiRequest(\Throwable $exception_stub) {
  $this->acquiadamClient
    ->method('getNotifications')
    ->will($this
    ->throwException($exception_stub));
  $actual = $this->assetRefreshManager
    ->updateQueue($this
    ->getAssetIdFieldsStub());
  $this
    ->assertEquals(0, $actual);
}