Skip to content
......@@ -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);
......
......@@ -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 = [];
......
......@@ -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)
{
......
<?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);
}
}