Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cloud
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
cloud
Merge requests
!488
Issue
#3246044
: Add test cases for OpenStack Admin Setting forms (Settings)
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Issue
#3246044
: Add test cases for OpenStack Admin Setting forms (Settings)
issue/cloud-3246044:3246044-Add-Test-Cases-For-Openstack-Settings
into
4.x
Overview
0
Commits
7
Pipelines
0
Changes
2
Closed
Yutong Li
requested to merge
issue/cloud-3246044:3246044-Add-Test-Cases-For-Openstack-Settings
into
4.x
3 years ago
Overview
0
Commits
7
Pipelines
0
Changes
2
Expand
0
0
Merge request reports
Compare
4.x
version 3
ff057029
3 years ago
version 2
4e3d497b
3 years ago
version 1
efbfb837
3 years ago
4.x (base)
and
latest version
latest version
fc5ef1cb
7 commits,
3 years ago
version 3
ff057029
6 commits,
3 years ago
version 2
4e3d497b
5 commits,
3 years ago
version 1
efbfb837
4 commits,
3 years ago
2 files
+
102
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
modules/cloud_service_providers/openstack/tests/src/Functional/Config/OpenStackAdminSettings.php
0 → 100644
+
66
−
0
Options
<?php
namespace
Drupal\Tests\openstack\Functional\Config
;
use
Drupal\Tests\openstack\Functional\OpenStackTestBase
;
use
Drupal\Tests\openstack\Traits\OpenStackTestFormDataTrait
;
/**
* Test Case class for OpenStack Admin Setting forms.
*
* @group OpenStack
*/
class
OpenStackAdminSettings
extends
OpenStackTestBase
{
use
OpenStackTestFormDataTrait
;
public
const
OPENSTACK_ADMIN_SETTINGS_REPEAT_COUNT
=
2
;
/**
* Get permissions of login user.
*
* @return array
* permissions of login user.
*/
protected
function
getPermissions
():
array
{
return
[
'administer openstack'
,
'administer site configuration'
,
];
}
/**
* Test for OpenStackAdminSettings.
*
* @param string $setting_type
* The setting type id.
* @param array $edit
* The array of input data.
*/
protected
function
runOpenStackAdminSettings
(
$setting_type
,
array
$edit
):
void
{
$this
->
drupalGet
(
"/admin/config/services/cloud/openstack/
{
$setting_type
}
"
);
$this
->
assertNoErrorMessage
();
$this
->
submitForm
(
$edit
,
$this
->
t
(
'Save'
)
);
$this
->
assertNoErrorMessage
();
}
/**
* Test OpenStack Admin Setting forms on Settings.
*/
public
function
testOpenStackAdminSettings
():
void
{
$edit
=
$this
->
createOpenStackSettingsFormData
(
self
::
OPENSTACK_ADMIN_SETTINGS_REPEAT_COUNT
);
for
(
$i
=
0
;
$i
<
self
::
OPENSTACK_ADMIN_SETTINGS_REPEAT_COUNT
;
$i
++
)
{
$edit
[
$i
]
=
array_intersect_key
(
$edit
[
$i
],
array_flip
(
(
array
)
array_rand
(
$edit
[
$i
],
random_int
(
1
,
count
(
$edit
[
$i
])))
));
$this
->
runOpenStackAdminSettings
(
'settings'
,
$edit
[
$i
]);
}
}
}
Loading