Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
9b8c6f7c
Unverified
Commit
9b8c6f7c
authored
Sep 18, 2017
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Testing the new methods on page repository
parent
15be04b5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
EloquentPageRepositoryTest.php
Modules/Page/Tests/EloquentPageRepositoryTest.php
+34
-0
No files found.
Modules/Page/Tests/EloquentPageRepositoryTest.php
View file @
9b8c6f7c
...
...
@@ -199,6 +199,23 @@ class EloquentPageRepositoryTest extends BasePageTest
$this
->
assertTrue
(
$page
->
translate
(
'fr'
)
->
status
);
}
/** @test */
public
function
it_can_mark_multiple_pages_as_online
()
{
$pageOne
=
$this
->
createRandomOfflinePage
();
$pageTwo
=
$this
->
createRandomOfflinePage
();
$this
->
page
->
markMultipleAsOnlineInAllLocales
([
1
,
2
]);
$pageOne
->
refresh
();
$pageTwo
->
refresh
();
$this
->
assertTrue
(
$pageOne
->
translate
(
'en'
)
->
status
);
$this
->
assertTrue
(
$pageOne
->
translate
(
'fr'
)
->
status
);
$this
->
assertTrue
(
$pageTwo
->
translate
(
'en'
)
->
status
);
$this
->
assertTrue
(
$pageTwo
->
translate
(
'fr'
)
->
status
);
}
/** @test */
public
function
it_can_mark_page_as_offline_in_all_locales
()
{
...
...
@@ -210,6 +227,23 @@ class EloquentPageRepositoryTest extends BasePageTest
$this
->
assertFalse
(
$page
->
translate
(
'fr'
)
->
status
);
}
/** @test */
public
function
it_can_mark_multiple_pages_as_offline
()
{
$pageOne
=
$this
->
createRandomOnlinePage
();
$pageTwo
=
$this
->
createRandomOnlinePage
();
$this
->
page
->
markMultipleAsOfflineInAllLocales
([
1
,
2
]);
$pageOne
->
refresh
();
$pageTwo
->
refresh
();
$this
->
assertFalse
(
$pageOne
->
translate
(
'en'
)
->
status
);
$this
->
assertFalse
(
$pageOne
->
translate
(
'fr'
)
->
status
);
$this
->
assertFalse
(
$pageTwo
->
translate
(
'en'
)
->
status
);
$this
->
assertFalse
(
$pageTwo
->
translate
(
'fr'
)
->
status
);
}
private
function
createPage
()
{
return
$this
->
page
->
create
([
...
...
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