Testing the new methods on page repository

parent 15be04b5
......@@ -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([
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment