@@ -101,24 +101,27 @@ public function testInitializeViewCacheReturnsExistingInstanceFromRegistry()
101101 public function testInitializeViewCacheReturnsNullWhenCacheDisabled ()
102102 {
103103 // Setup settings with cache disabled
104- $ Settings = $ this ->createMock ( \Neuron \Data \Setting \Source \ISettingSource::class );
105- $ Settings ->method ( 'get ' )
104+ $ SettingSource = $ this ->createMock ( \Neuron \Data \Setting \Source \ISettingSource::class );
105+ $ SettingSource ->method ( 'get ' )
106106 ->willReturnMap ( [
107107 ['cache ' , 'enabled ' , 'false ' ],
108108 ['cache ' , 'storage ' , 'file ' ],
109109 ['cache ' , 'path ' , 'cache/views ' ],
110110 ['cache ' , 'ttl ' , '3600 ' ]
111111 ] );
112-
112+
113+ // Wrap the mock source in a proper SettingManager
114+ $ Settings = new \Neuron \Data \Setting \SettingManager ( $ SettingSource );
115+
113116 $ Registry = Registry::getInstance ();
114117 $ Registry ->set ( 'Settings ' , $ Settings );
115-
118+
116119 // Create test controller
117120 $ Controller = new CacheInitTestController ( new Application () );
118-
121+
119122 // Test initialization returns null
120123 $ ViewCache = $ Controller ->testInitializeViewCache ();
121-
124+
122125 $ this ->assertNull ( $ ViewCache );
123126 $ this ->assertNull ( $ Registry ->get ( 'ViewCache ' ) );
124127 }
0 commit comments