Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
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
TeDomum
Nextcloud
Commits
d38a7c67
Unverified
Commit
d38a7c67
authored
4 years ago
by
Morris Jobke
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #23697 from nextcloud/bugfix/noid/fix-undefined-variable
Fix undefined variable
parents
4419d3e4
92be66cf
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
build/integration/features/bootstrap/CommandLine.php
+4
-27
4 additions, 27 deletions
build/integration/features/bootstrap/CommandLine.php
build/integration/features/transfer-ownership.feature
+6
-6
6 additions, 6 deletions
build/integration/features/transfer-ownership.feature
with
10 additions
and
33 deletions
build/integration/features/bootstrap/CommandLine.php
+
4
−
27
View file @
d38a7c67
...
@@ -23,6 +23,8 @@
...
@@ -23,6 +23,8 @@
*
*
*/
*/
use
PHPUnit\Framework\Assert
;
require
__DIR__
.
'/../../vendor/autoload.php'
;
require
__DIR__
.
'/../../vendor/autoload.php'
;
trait
CommandLine
{
trait
CommandLine
{
...
@@ -95,25 +97,6 @@ trait CommandLine {
...
@@ -95,25 +97,6 @@ trait CommandLine {
return
$exceptions
;
return
$exceptions
;
}
}
/**
* Finds all lines containing the given text
*
* @param string $input stdout or stderr output
* @param string $text text to search for
* @return array array of lines that matched
*/
public
function
findLines
(
$input
,
$text
)
{
$results
=
[];
// the exception text usually appears after an "[Exception"] row
foreach
(
explode
(
"
\n
"
,
$input
)
as
$line
)
{
if
(
strpos
(
$line
,
$text
)
>=
0
)
{
$results
[]
=
$line
;
}
}
return
$results
;
}
/**
/**
* @Then /^the command was successful$/
* @Then /^the command was successful$/
*/
*/
...
@@ -158,19 +141,13 @@ trait CommandLine {
...
@@ -158,19 +141,13 @@ trait CommandLine {
* @Then /^the command output contains the text "([^"]*)"$/
* @Then /^the command output contains the text "([^"]*)"$/
*/
*/
public
function
theCommandOutputContainsTheText
(
$text
)
{
public
function
theCommandOutputContainsTheText
(
$text
)
{
$lines
=
$this
->
findLines
(
$this
->
lastStdOut
,
$text
);
Assert
::
assertContains
(
$text
,
$this
->
lastStdOut
,
'The command did not output the expected text on stdout'
);
if
(
empty
(
$lines
))
{
throw
new
\Exception
(
'The command did not output the expected text on stdout "'
.
$exceptionText
.
'"'
);
}
}
}
/**
/**
* @Then /^the command error output contains the text "([^"]*)"$/
* @Then /^the command error output contains the text "([^"]*)"$/
*/
*/
public
function
theCommandErrorOutputContainsTheText
(
$text
)
{
public
function
theCommandErrorOutputContainsTheText
(
$text
)
{
$lines
=
$this
->
findLines
(
$this
->
lastStdErr
,
$text
);
Assert
::
assertContains
(
$text
,
$this
->
lastStdErr
,
'The command did not output the expected text on stderr'
);
if
(
empty
(
$lines
))
{
throw
new
\Exception
(
'The command did not output the expected text on stderr "'
.
$exceptionText
.
'"'
);
}
}
}
}
}
This diff is collapsed.
Click to expand it.
build/integration/features/transfer-ownership.feature
+
6
−
6
View file @
d38a7c67
...
@@ -297,13 +297,13 @@ Feature: transfer-ownership
...
@@ -297,13 +297,13 @@ Feature: transfer-ownership
Scenario
:
transferring ownership fails with invalid source user
Scenario
:
transferring ownership fails with invalid source user
Given
user
"user0"
exists
Given
user
"user0"
exists
When
transferring ownership from
"invalid_user"
to
"user0"
When
transferring ownership from
"invalid_user"
to
"user0"
Then
the command
error
output contains the text
"Unknown source user"
Then
the command output contains the text
"Unknown source user"
And
the command failed with exit code 1
And
the command failed with exit code 1
Scenario
:
transferring ownership fails with invalid target user
Scenario
:
transferring ownership fails with invalid target user
Given
user
"user0"
exists
Given
user
"user0"
exists
When
transferring ownership from
"user0"
to
"invalid_user"
When
transferring ownership from
"user0"
to
"invalid_user"
Then
the command
error
output contains the text
"Unknown
target
user"
Then
the command output contains the text
"Unknown
destination user invalid_
user"
And
the command failed with exit code 1
And
the command failed with exit code 1
Scenario
:
transferring ownership of a file
Scenario
:
transferring ownership of a file
...
@@ -511,7 +511,7 @@ Feature: transfer-ownership
...
@@ -511,7 +511,7 @@ Feature: transfer-ownership
And
user
"user2"
accepts last share
And
user
"user2"
accepts last share
When
transferring ownership of path
"test"
from
"user0"
to
"user1"
When
transferring ownership of path
"test"
from
"user0"
to
"user1"
Then
the command failed with exit code 1
Then
the command failed with exit code 1
And
the command
error
output contains the text
"Could not transfer files."
And
the command output contains the text
"Could not transfer files."
Scenario
:
transferring ownership does not transfer received shares
Scenario
:
transferring ownership does not transfer received shares
Given
user
"user0"
exists
Given
user
"user0"
exists
...
@@ -547,19 +547,19 @@ Feature: transfer-ownership
...
@@ -547,19 +547,19 @@ Feature: transfer-ownership
Given
user
"user0"
exists
Given
user
"user0"
exists
And
User
"user0"
created a folder
"/sub"
And
User
"user0"
created a folder
"/sub"
When
transferring ownership of path
"sub"
from
"invalid_user"
to
"user0"
When
transferring ownership of path
"sub"
from
"invalid_user"
to
"user0"
Then
the command
error
output contains the text
"Unknown source user"
Then
the command output contains the text
"Unknown source user"
And
the command failed with exit code 1
And
the command failed with exit code 1
Scenario
:
transferring ownership fails with invalid target user
Scenario
:
transferring ownership fails with invalid target user
Given
user
"user0"
exists
Given
user
"user0"
exists
And
User
"user0"
created a folder
"/sub"
And
User
"user0"
created a folder
"/sub"
When
transferring ownership of path
"sub"
from
"user0"
to
"invalid_user"
When
transferring ownership of path
"sub"
from
"user0"
to
"invalid_user"
Then
the command
error
output contains the text
"Unknown
target
user"
Then
the command output contains the text
"Unknown
destination user invalid_
user"
And
the command failed with exit code 1
And
the command failed with exit code 1
Scenario
:
transferring ownership fails with invalid path
Scenario
:
transferring ownership fails with invalid path
Given
user
"user0"
exists
Given
user
"user0"
exists
And
user
"user1"
exists
And
user
"user1"
exists
When
transferring ownership of path
"test"
from
"user0"
to
"user1"
When
transferring ownership of path
"test"
from
"user0"
to
"user1"
Then
the command
error
output contains the text
"Unknown
target user
"
Then the command output contains the text "Unknown
path provided
:
test
"
And
the command failed with exit code 1
And
the command failed with exit code 1
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