public function test_settings_manage_permission_needed_for_all_endpoints()
{
- $editor = $this->getEditor();
- $this->giveUserPermissions($editor, ['settings-manage']);
+ $editor = $this->users->editor();
+ $this->permissions->grantUserRolePermissions($editor, ['settings-manage']);
$this->actingAs($editor);
foreach ($this->endpointMap as [$method, $uri]) {
public function test_restrictions_manage_all_permission_needed_for_all_endpoints()
{
- $editor = $this->getEditor();
- $this->giveUserPermissions($editor, ['restrictions-manage-all']);
+ $editor = $this->users->editor();
+ $this->permissions->grantUserRolePermissions($editor, ['restrictions-manage-all']);
$this->actingAs($editor);
foreach ($this->endpointMap as [$method, $uri]) {
public function test_index_endpoint_returns_expected_page()
{
- $admin = $this->getAdmin();
+ $admin = $this->users->admin();
$page = $this->entities->page();
$book = $this->entities->book();
public function test_index_endpoint_returns_children_count()
{
- $admin = $this->getAdmin();
+ $admin = $this->users->admin();
$book = Book::query()->whereHas('pages')->whereHas('chapters')->withCount(['pages', 'chapters'])->first();
$this->actingAs($admin)->delete($book->getUrl());
public function test_index_endpoint_returns_parent()
{
- $admin = $this->getAdmin();
+ $admin = $this->users->admin();
$page = $this->entities->pageWithinChapter();
$this->actingAs($admin)->delete($page->getUrl());