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) Move the null defaults to the query builder, add it's spec test -
#631
· c77b883c
Guy Thouret
authored
Oct 02, 2019
c77b883c
(chore) Comment non-implemented test in NormalizeDatesDelegateSpec -
#631
· 13606976
Guy Thouret
authored
Oct 02, 2019
13606976
Hide whitespace changes
Inline
Side-by-side
Core/Boost/Campaigns/ElasticRepository.php
View file @
13606976
...
...
@@ -43,16 +43,7 @@ class ElasticRepository
{
$this
->
opts
=
array_merge
([
'limit'
=>
12
,
'from'
=>
0
,
'offset'
=>
null
,
'sort'
=>
'asc'
,
'type'
=>
null
,
'guid'
=>
null
,
'owner_guid'
=>
null
,
'entity_urn'
=>
null
,
'state'
=>
null
,
'rating'
=>
null
,
'quality'
=>
null
,
'from'
=>
0
],
$opts
);
$this
->
queryBuilder
->
setOpts
(
$opts
);
...
...
@@ -111,11 +102,7 @@ class ElasticRepository
{
$this
->
opts
=
array_merge
([
'limit'
=>
24
,
'from'
=>
0
,
'rating'
=>
null
,
'quality'
=>
null
,
'type'
=>
null
,
'sort'
=>
'asc'
,
'from'
=>
0
],
$opts
);
$this
->
queryBuilder
->
setOpts
(
$this
->
opts
);
...
...
Core/Boost/Campaigns/ElasticRepositoryQueryBuilder.php
View file @
13606976
...
...
@@ -17,7 +17,17 @@ class ElasticRepositoryQueryBuilder
public
function
reset
()
{
$this
->
opts
=
[];
$this
->
opts
=
[
'type'
=>
null
,
'guid'
=>
null
,
'owner_guid'
=>
null
,
'entity_urn'
=>
null
,
'state'
=>
null
,
'rating'
=>
null
,
'quality'
=>
null
,
'offset'
=>
null
,
'sort'
=>
'asc'
];
$this
->
must
=
[];
$this
->
mustNot
=
[];
$this
->
sort
=
[];
...
...
Spec/Core/Boost/Campaigns/Delegates/NormalizeDatesDelegateSpec.php
View file @
13606976
...
...
@@ -57,10 +57,10 @@ class NormalizeDatesDelegateSpec extends ObjectBehavior
$this
->
shouldThrow
(
CampaignException
::
class
)
->
during
(
'onCreate'
,
[
$campaign
]);
}
public
function
it_should_validate_dates_are_valid_against_campaign_budget_on_update
()
{
// TODO: Not Implemented yet
}
/*
public function it_should_validate_dates_are_valid_against_campaign_budget_on_update()
{
// TODO: Not Implemented yet
}
*/
public
function
it_should_not_change_start_date_if_campaign_has_started_on_update
(
Campaign
$campaign
,
Campaign
$campaignRef
)
{
...
...
Spec/Core/Boost/Campaigns/ElasticRepositoryQueryBuilderSpec.php
0 → 100644
View file @
13606976
<?php
namespace
Spec\Minds\Core\Boost\Campaigns
;
use
Minds\Core\Boost\Campaigns\ElasticRepositoryQueryBuilder
;
use
PhpSpec\ObjectBehavior
;
class
ElasticRepositoryQueryBuilderSpec
extends
ObjectBehavior
{
public
function
it_is_initializable
()
{
$this
->
shouldHaveType
(
ElasticRepositoryQueryBuilder
::
class
);
}
public
function
it_should_reset
()
{
$this
->
reset
();
}
public
function
it_should_make_a_query
()
{
$query
=
[
'query'
=>
[
'bool'
=>
[
'must'
=>
[],
'must_not'
=>
[],
],
],
'sort'
=>
[
'@timestamp'
=>
'asc'
,
],
];
$this
->
query
()
->
shouldReturn
(
$query
);
}
}