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 Jan 18, 2025
1 parent 1800a69 commit be4a995
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 @@ -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

0 comments on commit be4a995

Please sign in to comment.