class TestClient in Media: Acquia DAM 8
Overridden implementation of the Acquia DAM client for testing.
Hierarchy
- class \Drupal\media_acquiadam_test\TestClient
Expanded class hierarchy of TestClient
1 file declares its use of TestClient
- AcquiadamKernelTestBase.php in tests/
src/ Kernel/ AcquiadamKernelTestBase.php
File
- tests/
modules/ media_acquiadam_test/ src/ TestClient.php, line 10
Namespace
Drupal\media_acquiadam_testView source
class TestClient {
/**
* Array with test asset data.
*
* @var array
*/
protected $testAssets = [];
/**
* Array with test notifications.
*
* @var array
*/
protected $notifications = [];
/**
* Test data for Active XMP fields.
*
* @return array
* An empty array.
*/
public function getActiveXmpFields() {
return [];
}
/**
* Add a test notification.
*
* @param array $notification
* The test notification to add.
*/
public function addNotification(array $notification) {
$this->notifications[] = $notification;
}
/**
* Returns the notifications with the expected format.
*
* @return array
* The notifications with the expected format.
*/
public function getNotifications() {
return [
'total' => count($this->notifications),
'notifications' => $this->notifications,
];
}
/**
* Add or modify a test asset.
*
* @param \cweagans\webdam\Entity\Asset $asset
* The asset to add/modify.
*/
public function addAsset(Asset $asset) {
$this->testAssets[$asset->id] = $asset;
}
/**
* Get a test Asset given an Asset ID.
*
* @param int $assetId
* The test Asset ID.
*
* @return \cweagans\webdam\Entity\Asset
* The test asset.
*/
public function getAsset($assetId) {
return $this->testAssets[$assetId];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TestClient:: |
protected | property | Array with test notifications. | |
TestClient:: |
protected | property | Array with test asset data. | |
TestClient:: |
public | function | Add or modify a test asset. | |
TestClient:: |
public | function | Add a test notification. | |
TestClient:: |
public | function | Test data for Active XMP fields. | |
TestClient:: |
public | function | Get a test Asset given an Asset ID. | |
TestClient:: |
public | function | Returns the notifications with the expected format. |