Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
297
Merge Requests
41
CI / CD
Security & Compliance
Packages
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
96ff14bb
Commit
96ff14bb
authored
34 minutes ago
by
Guy Thouret
Browse files
Options
Download
(chore) Fix failing Boost Spec tests -
#1118
parent
06f00b68
goal/boost-campaigns-e24
1 merge request
!235
WIP: Boost Campaigns (&24)
Pipeline
#95496157
passed with stages
in 6 minutes and 40 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
8 deletions
+9
-8
Core/Boost/Campaigns/ElasticRepository.php
View file @
96ff14bb
...
...
@@ -140,7 +140,7 @@ class ElasticRepository
->
setCreatedTimestamp
(((
int
)
$doc
[
'_source'
][
'@timestamp'
])
?:
null
);
break
;
default
:
continue
;
continue
2
;
}
$data
[]
=
$entity
;
...
...
This diff is collapsed.
Spec/Core/Boost/Feeds/BoostSpec.php
View file @
96ff14bb
...
...
@@ -8,6 +8,7 @@ use Minds\Core\Boost\Network\Iterator;
use
Minds\Core\Data\cache\abstractCacher
;
use
Minds\Core\Entities\Resolver
;
use
Minds\Core\Feeds\FeedSyncEntity
;
use
Minds\Core\Time
;
use
Minds\Entities\Entity
;
use
Minds\Entities\User
;
use
PhpSpec\ObjectBehavior
;
...
...
@@ -45,12 +46,19 @@ class BoostSpec extends ObjectBehavior
'quality'
=>
0
];
$this
->
user
->
getGUID
()
->
shouldBeCalled
()
->
willReturn
(
1234
);
$this
->
user
->
get
(
'guid'
)
->
shouldBeCalled
()
->
willReturn
(
1234
);
$this
->
user
->
getTimeCreated
()
->
shouldBeCalled
()
->
willReturn
(
time
()
-
Time
::
TWO_HOUR
);
$this
->
user
->
getBoostRating
()
->
shouldBeCalled
()
->
willReturn
(
0
);
$this
->
iterator
->
setLimit
(
10
)
->
shouldBeCalled
()
->
willReturn
(
$this
->
iterator
);
$this
->
iterator
->
setOffset
(
10
)
->
shouldBeCalled
()
->
willReturn
(
$this
->
iterator
);
$this
->
iterator
->
setRating
(
0
)
->
shouldBeCalled
()
->
willReturn
(
$this
->
iterator
);
$this
->
iterator
->
setQuality
(
0
)
->
shouldBeCalled
()
->
willReturn
(
$this
->
iterator
);
$this
->
iterator
->
setType
(
'newsfeed'
)
->
shouldBeCalled
()
->
willReturn
(
$this
->
iterator
);
$this
->
iterator
->
setHydrate
(
false
)
->
shouldBeCalled
()
->
willReturn
(
$this
->
iterator
);
$this
->
iterator
->
setUserGuid
(
1234
)
->
shouldBeCalled
()
->
willReturn
(
$this
->
iterator
);
$this
->
iterator
->
rewind
()
->
shouldBeCalled
();
$this
->
iterator
->
valid
()
->
shouldBeCalled
()
->
willReturn
(
true
,
true
,
false
);
$this
->
iterator
->
current
()
->
shouldBeCalled
()
->
willReturn
(
$boost1
,
$boost2
);
...
...
This diff is collapsed.
Spec/Core/Boost/Network/ManagerSpec.php
View file @
96ff14bb
...
...
@@ -62,7 +62,6 @@ class ManagerSpec extends ObjectBehavior
$this
->
elasticRepository
->
getList
([
'state'
=>
'review'
,
'hydrate'
=>
true
,
'useElastic'
=>
true
,
])
->
shouldBeCalled
()
...
...
@@ -70,7 +69,6 @@ class ManagerSpec extends ObjectBehavior
$this
->
repository
->
getList
([
'state'
=>
'review'
,
'hydrate'
=>
true
,
'useElastic'
=>
true
,
'guids'
=>
[
1
,
2
],
])
...
...
@@ -109,7 +107,6 @@ class ManagerSpec extends ObjectBehavior
]);
$this
->
elasticRepository
->
getList
([
'state'
=>
'approved'
,
'hydrate'
=>
true
,
'useElastic'
=>
true
,
])
->
shouldBeCalled
()
...
...
@@ -150,7 +147,6 @@ class ManagerSpec extends ObjectBehavior
$this
->
repository
->
getList
([
'state'
=>
null
,
'guids'
=>
[
123
,
456
],
'hydrate'
=>
true
,
'useElastic'
=>
false
,
])
->
shouldBeCalled
()
...
...
@@ -205,7 +201,6 @@ class ManagerSpec extends ObjectBehavior
public
function
it_should_check_if_the_entity_was_already_boosted
(
Boost
$boost
,
Response
$response
)
{
$params
=
[
'hydrate'
=>
true
,
'useElastic'
=>
true
,
'state'
=>
'review'
,
'type'
=>
'newsfeed'
,
...
...
@@ -245,7 +240,6 @@ class ManagerSpec extends ObjectBehavior
public
function
it_should_request_offchain_boosts
(
Boost
$boost
,
Response
$response
)
{
$params
=
[
'hydrate'
=>
true
,
'useElastic'
=>
true
,
'state'
=>
'active'
,
'type'
=>
'newsfeed'
,
...
...
@@ -345,7 +339,6 @@ class ManagerSpec extends ObjectBehavior
public
function
runThroughGetList
(
$boost
,
$existingBoosts
,
$onchain
=
false
)
{
$this
->
elasticRepository
->
getList
([
"hydrate"
=>
true
,
"useElastic"
=>
true
,
"state"
=>
"active"
,
"type"
=>
"newsfeed"
,
...
...
This diff is collapsed.
Please
register
or
sign in
to comment