Skip to content

Commit 7d7b51a

Browse files
CopilotJJJ
andcommitted
Fix test: Create user with super admin privileges for network creation
Co-authored-by: JJJ <[email protected]>
1 parent 8d45b25 commit 7d7b51a

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

tests/integration/tests/test-networkoperations.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,23 @@ public function test_update_network_clears_cache() {
9191
}
9292

9393
public function test_plugin_auto_activates_on_new_network() {
94+
// Create a test user and grant super admin privileges.
95+
$user_id = $this->factory->user->create(
96+
array(
97+
'role' => 'administrator',
98+
)
99+
);
100+
grant_super_admin( $user_id );
101+
94102
// Create a test network using add_network().
95103
$network_id = add_network(
96104
array(
97-
'domain' => 'auto-activate-test.com',
98-
'path' => '/',
99-
'site_name' => 'Auto Activate Test',
100-
'network_name' => 'Test Network',
105+
'domain' => 'auto-activate-test.com',
106+
'path' => '/',
107+
'site_name' => 'Auto Activate Test',
108+
'network_name' => 'Test Network',
109+
'user_id' => $user_id,
110+
'network_admin_id' => $user_id,
101111
)
102112
);
103113

0 commit comments

Comments
 (0)