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
81455479
Unverified
Commit
81455479
authored
4 years ago
by
Joas Schilling
Browse files
Options
Downloads
Patches
Plain Diff
Fix unit tests
Signed-off-by:
Joas Schilling
<
coding@schilljs.com
>
parent
b974dd5b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/dav/tests/unit/Comments/CommentsNodeTest.php
+13
-8
13 additions, 8 deletions
apps/dav/tests/unit/Comments/CommentsNodeTest.php
with
13 additions
and
8 deletions
apps/dav/tests/unit/Comments/CommentsNodeTest.php
+
13
−
8
View file @
81455479
...
@@ -107,7 +107,7 @@ class CommentsNodeTest extends \Test\TestCase {
...
@@ -107,7 +107,7 @@ class CommentsNodeTest extends \Test\TestCase {
$this
->
node
->
delete
();
$this
->
node
->
delete
();
}
}
public
function
testDeleteForbidden
()
{
public
function
testDeleteForbidden
()
{
$this
->
expectException
(
\Sabre\DAV\Exception\Forbidden
::
class
);
$this
->
expectException
(
\Sabre\DAV\Exception\Forbidden
::
class
);
...
@@ -149,7 +149,7 @@ class CommentsNodeTest extends \Test\TestCase {
...
@@ -149,7 +149,7 @@ class CommentsNodeTest extends \Test\TestCase {
$this
->
assertSame
(
$this
->
node
->
getName
(),
$id
);
$this
->
assertSame
(
$this
->
node
->
getName
(),
$id
);
}
}
public
function
testSetName
()
{
public
function
testSetName
()
{
$this
->
expectException
(
\Sabre\DAV\Exception\MethodNotAllowed
::
class
);
$this
->
expectException
(
\Sabre\DAV\Exception\MethodNotAllowed
::
class
);
...
@@ -194,7 +194,7 @@ class CommentsNodeTest extends \Test\TestCase {
...
@@ -194,7 +194,7 @@ class CommentsNodeTest extends \Test\TestCase {
$this
->
assertTrue
(
$this
->
node
->
updateComment
(
$msg
));
$this
->
assertTrue
(
$this
->
node
->
updateComment
(
$msg
));
}
}
public
function
testUpdateCommentLogException
()
{
public
function
testUpdateCommentLogException
()
{
$this
->
expectException
(
\Exception
::
class
);
$this
->
expectException
(
\Exception
::
class
);
$this
->
expectExceptionMessage
(
'buh!'
);
$this
->
expectExceptionMessage
(
'buh!'
);
...
@@ -235,7 +235,7 @@ class CommentsNodeTest extends \Test\TestCase {
...
@@ -235,7 +235,7 @@ class CommentsNodeTest extends \Test\TestCase {
$this
->
node
->
updateComment
(
$msg
);
$this
->
node
->
updateComment
(
$msg
);
}
}
public
function
testUpdateCommentMessageTooLongException
()
{
public
function
testUpdateCommentMessageTooLongException
()
{
$this
->
expectException
(
\Sabre\DAV\Exception\BadRequest
::
class
);
$this
->
expectException
(
\Sabre\DAV\Exception\BadRequest
::
class
);
$this
->
expectExceptionMessage
(
'Message exceeds allowed character limit of'
);
$this
->
expectExceptionMessage
(
'Message exceeds allowed character limit of'
);
...
@@ -274,7 +274,7 @@ class CommentsNodeTest extends \Test\TestCase {
...
@@ -274,7 +274,7 @@ class CommentsNodeTest extends \Test\TestCase {
$this
->
node
->
updateComment
(
'foo'
);
$this
->
node
->
updateComment
(
'foo'
);
}
}
public
function
testUpdateForbiddenByUser
()
{
public
function
testUpdateForbiddenByUser
()
{
$this
->
expectException
(
\Sabre\DAV\Exception\Forbidden
::
class
);
$this
->
expectException
(
\Sabre\DAV\Exception\Forbidden
::
class
);
...
@@ -309,7 +309,7 @@ class CommentsNodeTest extends \Test\TestCase {
...
@@ -309,7 +309,7 @@ class CommentsNodeTest extends \Test\TestCase {
$this
->
node
->
updateComment
(
$msg
);
$this
->
node
->
updateComment
(
$msg
);
}
}
public
function
testUpdateForbiddenByType
()
{
public
function
testUpdateForbiddenByType
()
{
$this
->
expectException
(
\Sabre\DAV\Exception\Forbidden
::
class
);
$this
->
expectException
(
\Sabre\DAV\Exception\Forbidden
::
class
);
...
@@ -339,7 +339,7 @@ class CommentsNodeTest extends \Test\TestCase {
...
@@ -339,7 +339,7 @@ class CommentsNodeTest extends \Test\TestCase {
$this
->
node
->
updateComment
(
$msg
);
$this
->
node
->
updateComment
(
$msg
);
}
}
public
function
testUpdateForbiddenByNotLoggedIn
()
{
public
function
testUpdateForbiddenByNotLoggedIn
()
{
$this
->
expectException
(
\Sabre\DAV\Exception\Forbidden
::
class
);
$this
->
expectException
(
\Sabre\DAV\Exception\Forbidden
::
class
);
...
@@ -402,6 +402,7 @@ class CommentsNodeTest extends \Test\TestCase {
...
@@ -402,6 +402,7 @@ class CommentsNodeTest extends \Test\TestCase {
$ns
.
'latestChildDateTime'
=>
new
\DateTime
(
'2016-01-12 18:48:00'
),
$ns
.
'latestChildDateTime'
=>
new
\DateTime
(
'2016-01-12 18:48:00'
),
$ns
.
'objectType'
=>
'files'
,
$ns
.
'objectType'
=>
'files'
,
$ns
.
'objectId'
=>
'1848'
,
$ns
.
'objectId'
=>
'1848'
,
$ns
.
'referenceId'
=>
'ref'
,
$ns
.
'isUnread'
=>
null
,
$ns
.
'isUnread'
=>
null
,
];
];
...
@@ -468,6 +469,10 @@ class CommentsNodeTest extends \Test\TestCase {
...
@@ -468,6 +469,10 @@ class CommentsNodeTest extends \Test\TestCase {
->
method
(
'getObjectId'
)
->
method
(
'getObjectId'
)
->
willReturn
(
$expected
[
$ns
.
'objectId'
]);
->
willReturn
(
$expected
[
$ns
.
'objectId'
]);
$this
->
comment
->
expects
(
$this
->
once
())
->
method
(
'getReferenceId'
)
->
willReturn
(
$expected
[
$ns
.
'referenceId'
]);
$user
=
$this
->
getMockBuilder
(
IUser
::
class
)
$user
=
$this
->
getMockBuilder
(
IUser
::
class
)
->
disableOriginalConstructor
()
->
disableOriginalConstructor
()
->
getMock
();
->
getMock
();
...
@@ -483,7 +488,7 @@ class CommentsNodeTest extends \Test\TestCase {
...
@@ -483,7 +488,7 @@ class CommentsNodeTest extends \Test\TestCase {
$properties
=
$this
->
node
->
getProperties
(
null
);
$properties
=
$this
->
node
->
getProperties
(
null
);
foreach
(
$properties
as
$name
=>
$value
)
{
foreach
(
$properties
as
$name
=>
$value
)
{
$this
->
assert
True
(
array_key_exists
(
$name
,
$expected
)
)
;
$this
->
assert
ArrayHasKey
(
$name
,
$expected
);
$this
->
assertSame
(
$expected
[
$name
],
$value
);
$this
->
assertSame
(
$expected
[
$name
],
$value
);
unset
(
$expected
[
$name
]);
unset
(
$expected
[
$name
]);
}
}
...
...
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