Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
adeab41e
Commit
adeab41e
authored
9 years ago
by
Thomas Müller
Browse files
Options
Downloads
Plain Diff
Merge pull request #19616 from owncloud/ocs_provisioning_api_checking_lists
Ocs provisioning api checking lists
parents
12277869
8f91426e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
build/integration/features/bootstrap/FeatureContext.php
+44
-1
44 additions, 1 deletion
build/integration/features/bootstrap/FeatureContext.php
build/integration/features/provisioning-v1.feature
+20
-0
20 additions, 0 deletions
build/integration/features/provisioning-v1.feature
with
64 additions
and
1 deletion
build/integration/features/bootstrap/FeatureContext.php
+
44
−
1
View file @
adeab41e
...
...
@@ -49,7 +49,6 @@ class FeatureContext extends BehatContext {
$this
->
sendingToWith
(
$verb
,
$url
,
null
);
}
/**
* Parses the xml answer to get ocs response which doesn't match with
* http one in v1 of the api.
...
...
@@ -58,6 +57,50 @@ class FeatureContext extends BehatContext {
return
$response
->
xml
()
->
meta
[
0
]
->
statuscode
;
}
/**
* Parses the xml answer to get the array of users returned.
*/
public
function
getArrayOfUsersResponded
(
$resp
)
{
$listCheckedElements
=
$resp
->
xml
()
->
data
[
0
]
->
users
[
0
]
->
element
;
$extractedElementsArray
=
json_decode
(
json_encode
(
$listCheckedElements
)
,
1
);
return
$extractedElementsArray
;
}
/**
* Parses the xml answer to get the array of groups returned.
*/
public
function
getArrayOfGroupsResponded
(
$resp
)
{
$listCheckedElements
=
$resp
->
xml
()
->
data
[
0
]
->
groups
[
0
]
->
element
;
$extractedElementsArray
=
json_decode
(
json_encode
(
$listCheckedElements
)
,
1
);
return
$extractedElementsArray
;
}
/**
* @Then /^users returned are$/
* @param \Behat\Gherkin\Node\TableNode|null $formData
*/
public
function
theUsersShouldBe
(
$usersList
)
{
if
(
$usersList
instanceof
\Behat\Gherkin\Node\TableNode
)
{
$users
=
$usersList
->
getRows
()[
0
];
$respondedArray
=
$this
->
getArrayOfUsersResponded
(
$this
->
response
);
PHPUnit_Framework_Assert
::
assertEquals
(
asort
(
$users
),
asort
(
$respondedArray
));
}
}
/**
* @Then /^groups returned are$/
* @param \Behat\Gherkin\Node\TableNode|null $formData
*/
public
function
theGroupsShouldBe
(
$groupsList
)
{
if
(
$groupsList
instanceof
\Behat\Gherkin\Node\TableNode
)
{
$groups
=
$groupsList
->
getRows
()[
0
];
$respondedArray
=
$this
->
getArrayOfGroupsResponded
(
$this
->
response
);
PHPUnit_Framework_Assert
::
assertEquals
(
asort
(
$groups
),
asort
(
$respondedArray
));
}
}
/**
* @Then /^the OCS status code should be "([^"]*)"$/
*/
...
...
This diff is collapsed.
Click to expand it.
build/integration/features/provisioning-v1.feature
+
20
−
0
View file @
adeab41e
...
...
@@ -40,6 +40,16 @@ Feature: provisioning
And
the HTTP status code should be
"200"
Scenario
:
Getting all users
Given
As an
"admin"
And
user
"brand-new-user"
exists
And
user
"admin"
exists
When
sending
"GET"
to
"/cloud/users"
And
users returned are
|
brand-new-user
|
|
admin
|
Scenario
:
Edit a user
Given
As an
"admin"
And
user
"brand-new-user"
exists
...
...
@@ -74,6 +84,16 @@ Feature: provisioning
And
group
"new-group"
exists
Scenario
:
Getting all groups
Given
As an
"admin"
And
group
"new-group"
exists
And
group
"admin"
exists
When
sending
"GET"
to
"/cloud/groups"
And
groups returned are
|
admin
|
|
new-group
|
Scenario
:
Delete a group
Given
As an
"admin"
And
group
"new-group"
exists
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment