From 2f3806244cbbe589d3130efcef038b2a62f05afa Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Tue, 12 Dec 2023 15:41:56 +0000 Subject: [PATCH] Default templates: Added permission checks to selector test --- tests/Entity/EntitySearchTest.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/Entity/EntitySearchTest.php b/tests/Entity/EntitySearchTest.php index 7841a255e..9b77a32ab 100644 --- a/tests/Entity/EntitySearchTest.php +++ b/tests/Entity/EntitySearchTest.php @@ -262,7 +262,7 @@ class EntitySearchTest extends TestCase // Visit both to make popular $this->asEditor()->get($templatePage->getUrl()); - $this->asEditor()->get($nonTemplatePage->getUrl()); + $this->get($nonTemplatePage->getUrl()); $normalSearch = $this->get('/search/entity-selector-templates?term=test'); $normalSearch->assertSee($templatePage->name); @@ -275,6 +275,14 @@ class EntitySearchTest extends TestCase $defaultListTest = $this->get('/search/entity-selector-templates'); $defaultListTest->assertSee($templatePage->name); $defaultListTest->assertDontSee($nonTemplatePage->name); + + $this->permissions->disableEntityInheritedPermissions($templatePage); + + $normalSearch = $this->get('/search/entity-selector-templates?term=test'); + $normalSearch->assertDontSee($templatePage->name); + + $defaultListTest = $this->get('/search/entity-selector-templates'); + $defaultListTest->assertDontSee($templatePage->name); } public function test_sibling_search_for_pages()