Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Dependency List
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
150
Issues
150
List
Boards
Labels
Service Desk
Milestones
Merge Requests
48
Merge Requests
48
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Packages
Packages
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
Commits
1a53b79f
Commit
1a53b79f
authored
23 minutes ago
by
Mark Harding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(fix): failing spec tests
parent
86cf2577
refactor/es-feeds
1 merge request
!221
(refactor): support hydrating the first batch of entities
Pipeline
#70058480
failed with stages
in 3 minutes and 53 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
16 deletions
+79
-16
ScoredGuid.php
Core/Feeds/Top/ScoredGuid.php
+2
-0
ManagerSpec.php
Spec/Core/Feeds/Top/ManagerSpec.php
+65
-10
RepositorySpec.php
Spec/Core/Feeds/Top/RepositorySpec.php
+12
-6
No files found.
Core/Feeds/Top/ScoredGuid.php
View file @
1a53b79f
...
...
@@ -20,6 +20,8 @@ use Minds\Traits\MagicAttributes;
* @method ScoredGuid setOwnerGuid(int|string $ownerGuid)
* @method int getTimestamp()
* @method ScoredGuid setTimestamp(int $timestamp)
* @method string getType()
* @method ScoredGuid setType(string $type)
*/
class
ScoredGuid
{
...
...
This diff is collapsed.
Click to expand it.
Spec/Core/Feeds/Top/ManagerSpec.php
View file @
1a53b79f
...
...
@@ -65,10 +65,22 @@ class ManagerSpec extends ObjectBehavior
->
shouldBeCalled
()
->
willReturn
(
2
);
$entity1
->
get
(
'guid'
)
$scoredGuid1
->
getType
()
->
shouldBeCalled
()
->
willReturn
(
'object:image'
);
$entity1
->
getGUID
()
->
shouldBeCalled
()
->
willReturn
(
5000
);
$entity1
->
getOwnerGUID
()
->
shouldBeCalled
()
->
willReturn
(
1000
);
$entity1
->
getUrn
()
->
shouldBeCalled
()
->
willReturn
(
"urn:image:500"
);
$scoredGuid2
->
getGuid
()
->
shouldBeCalled
()
->
willReturn
(
5001
);
...
...
@@ -85,10 +97,22 @@ class ManagerSpec extends ObjectBehavior
->
shouldBeCalled
()
->
willReturn
(
1
);
$entity2
->
get
(
'guid'
)
$scoredGuid2
->
getType
()
->
shouldBeCalled
()
->
willReturn
(
'activity'
);
$entity2
->
getGUID
()
->
shouldBeCalled
()
->
willReturn
(
5001
);
$entity2
->
getOwnerGUID
()
->
shouldBeCalled
()
->
willReturn
(
1001
);
$entity2
->
getUrn
()
->
shouldBeCalled
()
->
willReturn
(
"urn:activity:5001"
);
$this
->
repository
->
getList
(
Argument
::
withEntry
(
'cache_key'
,
'phpspec'
))
->
shouldBeCalled
()
->
willReturn
([
$scoredGuid1
,
$scoredGuid2
]);
...
...
@@ -97,11 +121,14 @@ class ManagerSpec extends ObjectBehavior
->
shouldBeCalled
()
->
willReturn
([
$entity1
,
$entity2
]);
$this
$
response
=
$
this
->
getList
([
'cache_key'
=>
'phpspec'
,
])
->
shouldBeAResponse
([
$entity2
,
$entity1
]);
]);
$response
[
0
]
->
getUrn
()
->
shouldBe
(
'urn:image:500'
);
$response
[
1
]
->
getUrn
()
->
shouldBe
(
'urn:activity:5001'
);
}
public
function
it_should_get_list_by_query
(
...
...
@@ -127,10 +154,22 @@ class ManagerSpec extends ObjectBehavior
->
shouldBeCalled
()
->
willReturn
(
2
);
$entity1
->
get
(
'guid'
)
$scoredGuid1
->
getType
()
->
shouldBeCalled
()
->
willReturn
(
'activity'
);
$entity1
->
getGUID
()
->
shouldBeCalled
()
->
willReturn
(
5000
);
$entity1
->
getOwnerGUID
()
->
shouldBeCalled
()
->
willReturn
(
1000
);
$entity1
->
getUrn
()
->
shouldBeCalled
()
->
willReturn
(
"urn:activity:5000"
);
$scoredGuid2
->
getGuid
()
->
shouldBeCalled
()
->
willReturn
(
5001
);
...
...
@@ -146,11 +185,23 @@ class ManagerSpec extends ObjectBehavior
$scoredGuid2
->
getTimestamp
()
->
shouldBeCalled
()
->
willReturn
(
1
);
$scoredGuid2
->
getType
()
->
shouldBeCalled
()
->
willReturn
(
'activity'
);
$entity2
->
get
(
'guid'
)
$entity2
->
get
GUID
(
)
->
shouldBeCalled
()
->
willReturn
(
5001
);
$entity2
->
getOwnerGUID
()
->
shouldBeCalled
()
->
willReturn
(
1001
);
$entity2
->
getUrn
()
->
shouldBeCalled
()
->
willReturn
(
"urn:activity:5001"
);
$this
->
repository
->
getList
(
Argument
::
withEntry
(
'query'
,
'activity with hashtags'
))
->
shouldBeCalled
()
->
willReturn
([
$scoredGuid1
,
$scoredGuid2
]);
...
...
@@ -159,11 +210,15 @@ class ManagerSpec extends ObjectBehavior
->
shouldBeCalled
()
->
willReturn
([
$entity1
,
$entity2
]);
$this
$
response
=
$
this
->
getList
([
'query'
=>
'Activity with #hashtags'
,
])
->
shouldBeAResponse
([
$entity2
,
$entity1
]);
]);
$response
[
0
]
->
getUrn
()
->
shouldBe
(
'urn:activity:5000'
);
$response
[
1
]
->
getUrn
()
->
shouldBe
(
'urn:activity:5001'
);
}
function
getMatchers
()
...
...
This diff is collapsed.
Click to expand it.
Spec/Core/Feeds/Top/RepositorySpec.php
View file @
1a53b79f
...
...
@@ -56,7 +56,8 @@ class RepositorySpec extends ObjectBehavior
'time_created'
=>
1
,
'@timestamp'
=>
1000
,
],
'_score'
=>
100
'_score'
=>
100
,
'_type'
=>
'activity'
,
],
[
'_source'
=>
[
...
...
@@ -65,7 +66,8 @@ class RepositorySpec extends ObjectBehavior
'time_created'
=>
1
,
'@timestamp'
=>
1000
,
],
'_score'
=>
50
'_score'
=>
50
,
'_type'
=>
'activity'
,
],
]
]
...
...
@@ -104,7 +106,8 @@ class RepositorySpec extends ObjectBehavior
'time_created'
=>
1
,
'@timestamp'
=>
1000
,
],
'_score'
=>
100
'_score'
=>
100
,
'_type'
=>
'user'
,
],
[
'_source'
=>
[
...
...
@@ -113,7 +116,8 @@ class RepositorySpec extends ObjectBehavior
'time_created'
=>
2
,
'@timestamp'
=>
2000
,
],
'_score'
=>
50
'_score'
=>
50
,
'_type'
=>
'user'
,
],
]
]
...
...
@@ -153,7 +157,8 @@ class RepositorySpec extends ObjectBehavior
'@timestamp'
=>
1000
,
'container_guid'
=>
'1'
,
],
'_score'
=>
100
'_score'
=>
100
,
'_type'
=>
'group'
,
],
[
'_source'
=>
[
...
...
@@ -163,7 +168,8 @@ class RepositorySpec extends ObjectBehavior
'@timestamp'
=>
2000
,
'container_guid'
=>
'2'
,
],
'_score'
=>
50
'_score'
=>
50
,
'_type'
=>
'group'
,
],
]
]
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment