Skip to content

Commit e4dfc84

Browse files
committed
Merge branch 'master' of github.com:stuttter/wp-multi-network
2 parents 312d6a8 + 9fceb64 commit e4dfc84

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/integration/tests/test-networkoperations.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,28 @@ public function test_switch_to_network() {
6565

6666
$this->assertEquals( 1, $current_site->id, 'Switching back should switch the network' );
6767
}
68+
69+
public function test_update_network_clears_cache() {
70+
// Create a test network.
71+
$network_id = $this->factory->network->create(
72+
array(
73+
'domain' => 'example.com',
74+
'path' => '/test/',
75+
)
76+
);
77+
78+
// Get the network to populate cache.
79+
$network = get_network( $network_id );
80+
$this->assertEquals( 'example.com', $network->domain, 'Network should have original domain' );
81+
$this->assertEquals( '/test/', $network->path, 'Network should have original path' );
82+
83+
// Update the network with new domain and path.
84+
$result = update_network( $network_id, 'newdomain.com', '/newpath/' );
85+
$this->assertTrue( $result, 'Network update should succeed' );
86+
87+
// Get the network again - it should reflect the updated values.
88+
$updated_network = get_network( $network_id );
89+
$this->assertEquals( 'newdomain.com', $updated_network->domain, 'Network should have updated domain without manual cache flush' );
90+
$this->assertEquals( '/newpath/', $updated_network->path, 'Network should have updated path without manual cache flush' );
91+
}
6892
}

0 commit comments

Comments
 (0)