Skip to content

Commit

Permalink
Fix some of the failing tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
finnlewis committed Oct 31, 2024
1 parent 078b43f commit 143a939
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/src/Kernel/ContentTypeHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ class ContentTypeHelperTest extends GroupKernelTestBase {
protected function setUp(): void {
parent::setUp();

// Set config that group_sites needs to run tests.
$this->config('group_sites.settings')
->set('no_site_access_policy', 'group_sites.no_site_access_policy.do_nothing')
->set('site_access_policy', 'group_sites.site_access_policy.single')
->save();

// You really don't want to install localgov_page or localgov_events in a
// Kernel test!
NodeType::create([
Expand Down
6 changes: 6 additions & 0 deletions tests/src/Kernel/GroupDefaultContentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ class GroupDefaultContentTest extends GroupKernelTestBase {
protected function setUp(): void {
parent::setUp();

// Set config that group_sites needs to run tests.
$this->config('group_sites.settings')
->set('no_site_access_policy', 'group_sites.no_site_access_policy.do_nothing')
->set('site_access_policy', 'group_sites.site_access_policy.single')
->save();

$this->installEntitySchema('group_content_menu');
$this->installSchema('node', 'node_access');

Expand Down
8 changes: 8 additions & 0 deletions tests/src/Kernel/UserRoleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class UserRoleTest extends GroupKernelTestBase {
'group',
'group_content_menu',
'group_sites',
'group_sites_test',
'image',
'media',
'media_library',
Expand All @@ -37,6 +38,13 @@ class UserRoleTest extends GroupKernelTestBase {
protected function setUp(): void {
parent::setUp();

// Set config that group_sites needs to run tests.
$this->config('group_sites.settings')
->set('context_provider', '@group_sites_test.hardcoded_group_context:group')
->set('no_site_access_policy', 'group_sites.no_site_access_policy.do_nothing')
->set('site_access_policy', 'group_sites.site_access_policy.single')
->save();

$this->installEntitySchema('group');
$this->installEntitySchema('group_relationship');
$this->installEntitySchema('user');
Expand Down

0 comments on commit 143a939

Please sign in to comment.