diff --git a/system/Commands/Utilities/Optimize.php b/system/Commands/Utilities/Optimize.php index 958acf5a6072..b60fbe64004a 100644 --- a/system/Commands/Utilities/Optimize.php +++ b/system/Commands/Utilities/Optimize.php @@ -178,6 +178,8 @@ private function runCaching(?bool $enableConfigCache, ?bool $enableLocatorCache, /** * Disable Caching + * + * @return array */ private function disableCaching(): array { @@ -191,6 +193,7 @@ private function disableCaching(): array * Enable Caching * * @param array $options + * @return array */ private function enableCaching(array $options): array { diff --git a/tests/system/Commands/Utilities/OptimizeTest.php b/tests/system/Commands/Utilities/OptimizeTest.php index 9a901b010717..48fe4fbe3b27 100644 --- a/tests/system/Commands/Utilities/OptimizeTest.php +++ b/tests/system/Commands/Utilities/OptimizeTest.php @@ -41,10 +41,10 @@ public function testEnableConfigCaching(): void { $command = new Optimize(service('logger'), service('commands')); - $enableCaching = $this->getPrivateMethodInvoker($command, 'enableCaching'); + $runCaching = $this->getPrivateMethodInvoker($command, 'runCaching'); - // private function enableCaching(?bool $enableConfigCache, ?bool $enableLocatorCache, ?bool $disable): void - $enableCaching(true, null, null); + // private function runCaching(?bool $enableConfigCache, ?bool $enableLocatorCache, ?bool $disable): void + $runCaching(true, null, null); // Check if config caching is enabled $this->assertFileContains('public bool $configCacheEnabled = true;', APPPATH . 'Config/Optimize.php'); @@ -54,10 +54,10 @@ public function testEnableLocatorCaching(): void { $command = new Optimize(service('logger'), service('commands')); - $enableCaching = $this->getPrivateMethodInvoker($command, 'enableCaching'); + $runCaching = $this->getPrivateMethodInvoker($command, 'runCaching'); - // private function enableCaching(?bool $enableConfigCache, ?bool $enableLocatorCache, ?bool $disable): void - $enableCaching(null, true, null); + // private function runCaching(?bool $enableConfigCache, ?bool $enableLocatorCache, ?bool $disable): void + $runCaching(null, true, null); // Check if locator caching is enabled $this->assertFileContains('public bool $locatorCacheEnabled = true;', APPPATH . 'Config/Optimize.php'); @@ -67,10 +67,10 @@ public function testDisableCaching(): void { $command = new Optimize(service('logger'), service('commands')); - $enableCaching = $this->getPrivateMethodInvoker($command, 'enableCaching'); + $runCaching = $this->getPrivateMethodInvoker($command, 'runCaching'); - // private function enableCaching(?bool $enableConfigCache, ?bool $enableLocatorCache, ?bool $disable): void - $enableCaching(null, null, true); + // private function runCaching(?bool $enableConfigCache, ?bool $enableLocatorCache, ?bool $disable): void + $runCaching(null, null, true); // Check if both caches are disabled $this->assertFileContains('public bool $configCacheEnabled = false;', APPPATH . 'Config/Optimize.php'); @@ -81,10 +81,10 @@ public function testWithoutOptions(): void { $command = new Optimize(service('logger'), service('commands')); - $enableCaching = $this->getPrivateMethodInvoker($command, 'enableCaching'); + $runCaching = $this->getPrivateMethodInvoker($command, 'runCaching'); - // private function enableCaching(?bool $enableConfigCache, ?bool $enableLocatorCache, ?bool $disable): void - $enableCaching(null, null, null); + // private function runCaching(?bool $enableConfigCache, ?bool $enableLocatorCache, ?bool $disable): void + $runCaching(null, null, null); // Check if both caches are disabled $this->assertFileContains('public bool $configCacheEnabled = true;', APPPATH . 'Config/Optimize.php');