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
228
Issues
228
List
Boards
Labels
Service Desk
Milestones
Merge Requests
32
Merge Requests
32
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
Compare Revisions
5955563cac1cff4770d2ef1c3dd2b2d8515c0ad0...c2d3768c91447656e75ea1e29333db06a0add209
Source
c2d3768c91447656e75ea1e29333db06a0add209
Select Git revision
...
Target
5955563cac1cff4770d2ef1c3dd2b2d8515c0ad0
Select Git revision
Compare
Commits (2)
(chore) Fix and lint Boost Campaigns Manager spec test again -
#631
· f6609fa6
Guy Thouret
authored
45 minutes ago
f6609fa6
Fix linting in Boost Campaign Manager Spec -
#631
· c2d3768c
Guy Thouret
authored
44 minutes ago
c2d3768c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
3 deletions
+28
-3
Core/Boost/Campaigns/Stats.php
Core/Boost/Campaigns/Stats.php
+10
-0
Spec/Core/Boost/Campaigns/ManagerSpec.php
Spec/Core/Boost/Campaigns/ManagerSpec.php
+18
-3
No files found.
Core/Boost/Campaigns/Stats.php
View file @
c2d3768c
...
...
@@ -2,8 +2,18 @@
namespace
Minds\Core\Boost\Campaigns
;
use
Elasticsearch\Client
;
class
Stats
{
/** @var Client */
protected
$esClient
;
public
function
__construct
(
Client
$esClient
)
{
}
/**
* @param Campaign $campaign
* @return array
...
...
This diff is collapsed.
Click to expand it.
Spec/Core/Boost/Campaigns/ManagerSpec.php
View file @
c2d3768c
...
...
@@ -63,8 +63,7 @@ class ManagerSpec extends ObjectBehavior
NormalizeHashtagsDelegate
$normalizeHashtagsDelegate
,
PaymentsDelegate
$paymentsDelegate
,
User
$user
)
{
)
{
$this
->
beConstructedWith
(
$repository
,
$elasticRepository
,
...
...
@@ -394,8 +393,24 @@ class ManagerSpec extends ObjectBehavior
$this
->
completeCampaign
(
$campaignRef
)
->
shouldReturn
(
$campaign
);
}
public
function
it_should_perform_actions_on_payment_success
(
Payment
$payment
)
public
function
it_should_perform_actions_on_payment_success
(
Payment
$payment
,
Campaign
$campaign
,
Response
$response
)
{
$payment
->
getCampaignGuid
()
->
shouldBeCalled
()
->
willReturn
(
1234
);
$this
->
repository
->
getCampaignByGuid
(
Argument
::
type
(
'array'
))
->
shouldBeCalled
()
->
willReturn
(
$response
);
$response
->
map
(
Argument
::
type
(
'Callable'
))
->
willReturn
(
$response
);
$response
->
toArray
()
->
shouldBeCalled
()
->
willReturn
([
$campaign
]);
$this
->
paymentsDelegate
->
onConfirm
(
$campaign
,
$payment
)
->
shouldBeCalled
()
->
willReturn
(
$campaign
);
$this
->
repository
->
putCampaign
(
$campaign
)
->
shouldBeCalled
();
$this
->
elasticRepository
->
putCampaign
(
$campaign
)
->
shouldBeCalled
();
$this
->
queueClient
->
setQueue
(
'BoostCampaignDispatcher'
)
->
shouldBeCalled
()
->
willReturn
(
$this
->
queueClient
);
$this
->
queueClient
->
send
(
Argument
::
type
(
'array'
))
->
shouldBeCalled
();
$this
->
onPaymentSuccess
(
$payment
);
}
}
This diff is collapsed.
Click to expand it.