protected function prepareRoleImage($name)
{
foreach ($this->sets[$name] as &$roleImageData) {
if (in_array($roleImageData['platform'], [SERVER_PLATFORMS::GCE, SERVER_PLATFORMS::AZURE])) {
$roleImageData['cloudLocation'] = '';
}
/* @var $image Entity\Image */
$image = Entity\Image::findOne([['cloudLocation' => $roleImageData['cloudLocation']], ['platform' => $roleImageData['platform']], ['$or' => [['accountId' => static::$user->getAccountId()], ['accountId' => null]]]]);
if (empty($image)) {
ApiTest::markTestIncomplete(sprintf('Image with cloudLocation %s and platform %s not isset', $roleImageData['cloudLocation'], $roleImageData['platform']));
}
$roleImageData['imageId'] = $image->id;
ApiTest::createEntity(new Entity\RoleImage(), $roleImageData);
}
}