File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments