Skip to content

Commit

Permalink
add config tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrajodas committed Jan 22, 2025
1 parent 8158f37 commit 896748c
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions tests/phpunit/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,5 +356,68 @@ public function invalidConfigDataProvider(): Generator
],
'The child node "backupId" at path "root.parameters" must be configured.',
];

yield 'gcs-missing-backupId' => [
[
'action' => 'run',
'parameters' => [
],
'image_parameters' => [
'storageBackendType' => Config::STORAGE_BACKEND_GCS,
'#jsonKey' => 'testJsonKey',
'#bucket' => 'testBucket',
'region' => 'testRegion',
],
],
'The child node "backupId" at path "root.parameters" must be configured.',
];

yield 'gcs-missing-jsonKey' => [
[
'action' => 'run',
'parameters' => [
'backupId' => 'testBackupId',
'storageBackendType' => Config::STORAGE_BACKEND_GCS,
'#bucket' => 'testBucket',
'region' => 'testRegion',
],
'image_parameters' => [
'storageBackendType' => Config::STORAGE_BACKEND_GCS,
],
],
'Missing required parameter "#jsonKey".',
];

yield 'gcs-missing-bucket' => [
[
'action' => 'run',
'parameters' => [
'backupId' => 'testBackupId',
'storageBackendType' => Config::STORAGE_BACKEND_GCS,
'#jsonKey' => 'testJsonKey',
'region' => 'testRegion',
],
'image_parameters' => [
'storageBackendType' => Config::STORAGE_BACKEND_GCS,
],
],
'Missing required parameter "#bucket".',
];

yield 'gcs-missing-region' => [
[
'action' => 'run',
'parameters' => [
'backupId' => 'testBackupId',
'storageBackendType' => Config::STORAGE_BACKEND_GCS,
'#jsonKey' => 'testJsonKey',
'#bucket' => 'testBucket',
],
'image_parameters' => [
'storageBackendType' => Config::STORAGE_BACKEND_GCS,
],
],
'Missing required parameter "region".',
];
}
}

0 comments on commit 896748c

Please sign in to comment.