Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
212
Issues
212
List
Boards
Labels
Service Desk
Milestones
Merge Requests
33
Merge Requests
33
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
51f551dd
Commit
51f551dd
authored
1 hour ago
by
Mark Harding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(fix): failing tests
parent
94b95611
epic/permissions-sub-reqs
1 merge request
!327
WIP: Subscription Requests - #604
Pipeline
#82714849
passed with stages
in 10 minutes and 46 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
10 deletions
+8
-10
Manager.php
Core/Subscriptions/Requests/Manager.php
+2
-2
ManagerSpec.php
Spec/Core/Subscriptions/Requests/ManagerSpec.php
+2
-4
RepositorySpec.php
Spec/Core/Subscriptions/Requests/RepositorySpec.php
+4
-4
No files found.
Core/Subscriptions/Requests/Manager.php
View file @
51f551dd
...
...
@@ -105,7 +105,7 @@ class Manager
throw
new
SubscriptionRequestDoesntExistException
();
}
if
(
$existing
->
getAccepted
()
!==
null
)
{
if
(
$existing
->
isDeclined
()
)
{
throw
new
SubscriptionRequestAlreadyCompletedException
();
}
...
...
@@ -130,7 +130,7 @@ class Manager
throw
new
SubscriptionRequestDoesntExistException
();
}
if
(
$existing
->
getAccepted
()
!==
null
)
{
if
(
$existing
->
isDeclined
()
)
{
throw
new
SubscriptionRequestAlreadyCompletedException
();
}
...
...
This diff is collapsed.
Click to expand it.
Spec/Core/Subscriptions/Requests/ManagerSpec.php
View file @
51f551dd
...
...
@@ -67,9 +67,7 @@ class ManagerSpec extends ObjectBehavior
$this
->
repository
->
get
(
"urn:subscription-request:123-456"
)
->
willReturn
(
$subscriptionRequest
);
$this
->
repository
->
update
(
Argument
::
that
(
function
(
$sr
)
{
return
$sr
->
getAccepted
()
===
true
;
}))
$this
->
repository
->
delete
(
Argument
::
any
())
->
willReturn
(
true
);
$this
->
notificationsDelegate
->
onAccept
(
$subscriptionRequest
)
...
...
@@ -92,7 +90,7 @@ class ManagerSpec extends ObjectBehavior
->
willReturn
(
$subscriptionRequest
);
$this
->
repository
->
update
(
Argument
::
that
(
function
(
$sr
)
{
return
$sr
->
getAccepted
()
===
fals
e
;
return
$sr
->
isDeclined
()
===
tru
e
;
}))
->
willReturn
(
true
);
...
...
This diff is collapsed.
Click to expand it.
Spec/Core/Subscriptions/Requests/RepositorySpec.php
View file @
51f551dd
...
...
@@ -31,8 +31,8 @@ class RepositorySpec extends ObjectBehavior
{
$this
->
db
->
request
(
Argument
::
that
(
function
(
$prepared
)
{
$query
=
$prepared
->
build
();
return
$query
[
'values'
][
0
]
=
==
'123'
&&
$query
[
'values'
][
1
]
=
==
'456'
;
return
$query
[
'values'
][
0
]
->
value
()
==
'123'
&&
$query
[
'values'
][
1
]
->
value
()
==
'456'
;
}))
->
willReturn
(
new
Rows
([
[
...
...
@@ -54,7 +54,7 @@ class RepositorySpec extends ObjectBehavior
{
$this
->
db
->
request
(
Argument
::
that
(
function
(
$prepared
)
{
$query
=
$prepared
->
build
();
return
$query
[
'values'
][
0
]
=
==
'123'
;
return
$query
[
'values'
][
0
]
->
value
()
==
'123'
;
}))
->
willReturn
(
new
Rows
([
[
...
...
@@ -115,7 +115,7 @@ class RepositorySpec extends ObjectBehavior
$this
->
db
->
request
(
Argument
::
that
(
function
(
$prepared
)
{
$values
=
$prepared
->
build
()[
'values'
];
return
$values
[
0
]
->
value
()
==
true
return
$values
[
0
]
==
true
&&
$values
[
1
]
->
value
()
===
'123'
&&
$values
[
2
]
->
value
()
===
'456'
;
}))
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment