1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Quick run through of applying new test entity helper class

This commit is contained in:
Dan Brown
2022-09-29 22:11:16 +01:00
parent b56f7355aa
commit 900e853b15
47 changed files with 198 additions and 286 deletions

View File

@ -4,7 +4,6 @@ namespace Tests\Entity;
use BookStack\Auth\UserRepo;
use BookStack\Entities\Models\Entity;
use BookStack\Entities\Repos\PageRepo;
use Tests\TestCase;
class EntityAccessTest extends TestCase
@ -16,7 +15,7 @@ class EntityAccessTest extends TestCase
$updater = $this->getViewer();
$entities = $this->entities->createChainBelongingToUser($creator, $updater);
app()->make(UserRepo::class)->destroy($creator);
app()->make(PageRepo::class)->update($entities['page'], ['html' => '<p>hello!</p>>']);
$this->entities->updatePage($entities['page'], ['html' => '<p>hello!</p>>']);
$this->checkEntitiesViewable($entities);
}
@ -28,7 +27,7 @@ class EntityAccessTest extends TestCase
$updater = $this->getEditor();
$entities = $this->entities->createChainBelongingToUser($creator, $updater);
app()->make(UserRepo::class)->destroy($updater);
app()->make(PageRepo::class)->update($entities['page'], ['html' => '<p>Hello there!</p>']);
$this->entities->updatePage($entities['page'], ['html' => '<p>Hello there!</p>']);
$this->checkEntitiesViewable($entities);
}