Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access permissions 6: Complete test cases #6882

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/Cms/Files/FilePermissionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@ public function setUp(): void
public static function actionProvider(): array
{
return [
['access'],
['changeName'],
// ['changeTemplate'], Tested separately because of the needed blueprints
['create'],
['delete'],
['list'],
['replace'],
['sort'],
['update']
];
}
Expand Down
12 changes: 11 additions & 1 deletion tests/Cms/Pages/PagePermissionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Kirby\Exception\LogicException;
use Kirby\TestCase;
use ReflectionProperty;

/**
* @coversDefaultClass \Kirby\Cms\PagePermissions
Expand All @@ -22,16 +23,25 @@ public function setUp(): void
]);
}

public function tearDown(): void
{
$prop = new ReflectionProperty(PagePermissions::class, 'cache');
$prop->setValue(null, []);
}

public static function actionProvider(): array
{
return [
['access'],
['changeSlug'],
['changeStatus'],
// ['changeTemplate'], Returns false because of only one blueprint
// ['changeTemplate'], Tested separately because of the needed blueprints
['changeTitle'],
['create'],
['delete'],
['duplicate'],
['list'],
['move'],
['preview'],
['sort'],
['update'],
Expand Down
Loading