Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Commits on Source (2)
(chore) Fix and lint Boost Campaigns Manager spec test again -
#631
· f6609fa6
Guy Thouret
authored
Oct 09, 2019
f6609fa6
Fix linting in Boost Campaign Manager Spec -
#631
· c2d3768c
Guy Thouret
authored
Oct 09, 2019
c2d3768c
Hide whitespace changes
Inline
Side-by-side
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
...
...
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
);
}
}