Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
221
Issues
221
List
Boards
Labels
Service Desk
Milestones
Merge Requests
30
Merge Requests
30
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
List
Container Registry
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
2042213a
Commit
2042213a
authored
15 minutes ago
by
Juan Manuel Solaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(test) add specs for scheduled manager and repository
parent
54fe5e28
epic/post-scheduler
1 merge request
!294
WIP: epic/post-scheduler
Pipeline
#77654334
passed with stages
in 9 minutes and 42 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
100 additions
and
0 deletions
+100
-0
ManagerSpec.php
Spec/Core/Feeds/Scheduled/ManagerSpec.php
+45
-0
RepositorySpec.php
Spec/Core/Feeds/Scheduled/RepositorySpec.php
+55
-0
No files found.
Spec/Core/Feeds/Scheduled/ManagerSpec.php
0 → 100644
View file @
2042213a
<?php
namespace
Spec\Minds\Core\Feeds\Scheduled
;
use
Minds\Core\EntitiesBuilder
;
use
Minds\Core\Feeds\Scheduled\Manager
;
use
Minds\Core\Feeds\Scheduled\Repository
;
use
Minds\Core\Search\Search
;
use
PhpSpec\ObjectBehavior
;
class
ManagerSpec
extends
ObjectBehavior
{
/** @var Repository */
protected
$repository
;
/** @var EntitiesBuilder */
protected
$entitiesBuilder
;
/** @var Search */
protected
$search
;
function
let
(
Repository
$repository
)
{
$this
->
repository
=
$repository
;
$this
->
beConstructedWith
(
$repository
);
}
function
it_is_initializable
()
{
$this
->
shouldHaveType
(
Manager
::
class
);
}
public
function
it_should_get_scheduled_count
()
{
$argument
=
[
'container_guid'
=>
9999
,
'type'
=>
'activity'
];
$this
->
repository
->
getScheduledCount
(
$argument
)
->
shouldBeCalled
()
->
willReturn
(
1
);
$this
->
getScheduledCount
(
$argument
);
}
}
This diff is collapsed.
Click to expand it.
Spec/Core/Feeds/Scheduled/RepositorySpec.php
0 → 100644
View file @
2042213a
<?php
namespace
Spec\Minds\Core\Feeds\Scheduled
;
use
Minds\Core\Config
;
use
Minds\Core\Data\ElasticSearch\Client
;
use
Minds\Core\Data\ElasticSearch\Prepared\Count
;
use
Minds\Core\Feeds\Scheduled\Repository
;
use
PhpSpec\ObjectBehavior
;
use
Prophecy\Argument
;
class
RepositorySpec
extends
ObjectBehavior
{
/** @var Client */
protected
$client
;
/** @var Config */
protected
$config
;
function
let
(
Client
$client
,
Config
$config
)
{
$this
->
client
=
$client
;
$this
->
config
=
$config
;
$config
->
get
(
'elasticsearch'
)
->
shouldBeCalled
()
->
willReturn
([
'index'
=>
'minds'
]);
$this
->
beConstructedWith
(
$client
,
$config
);
}
function
it_is_initializable
()
{
$this
->
shouldHaveType
(
Repository
::
class
);
}
function
it_should_count_scheduled_activities
()
{
$opts
=
[
'container_guid'
=>
9999
,
'type'
=>
'activity'
];
$this
->
client
->
request
(
Argument
::
type
(
Count
::
class
))
->
shouldBeCalled
()
->
willReturn
([
"count"
=>
1
,
"_shards"
=>
[
"total"
=>
5
,
"successful"
=>
5
,
"skipped"
=>
0
,
"failed"
=>
0
]
]);
$this
->
getScheduledCount
(
$opts
);
}
}
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