Skip to content

Commit

Permalink
Complete test cases for existing permissions
Browse files Browse the repository at this point in the history
We have added these permissions since creating these tests and seem to have forgotten to add them here as well
  • Loading branch information
lukasbestle committed Dec 23, 2024
1 parent d189e6f commit 6abcde3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions tests/Cms/Files/FilePermissionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,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 @@ -3,6 +3,7 @@
namespace Kirby\Cms;

use Kirby\TestCase;
use ReflectionProperty;

/**
* @coversDefaultClass \Kirby\Cms\PagePermissions
Expand All @@ -21,16 +22,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

0 comments on commit 6abcde3

Please sign in to comment.