File tree 1 file changed +2
-20
lines changed
tests/system/Commands/Utilities
1 file changed +2
-20
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ protected function getBuffer(): string
40
40
public function testEnableConfigCaching (): void
41
41
{
42
42
command ('optimize -c ' );
43
-
43
+
44
44
// Check if config caching is enabled
45
45
$ this ->assertFileContains ('public bool $configCacheEnabled = true; ' , APPPATH . 'Config/Optimize.php ' );
46
46
}
@@ -56,30 +56,12 @@ public function testEnableLocatorCaching(): void
56
56
public function testDisableCaching (): void
57
57
{
58
58
command ('optimize -d ' );
59
+
59
60
// Check if both caches are disabled
60
61
$ this ->assertFileContains ('public bool $configCacheEnabled = false; ' , APPPATH . 'Config/Optimize.php ' );
61
62
$ this ->assertFileContains ('public bool $locatorCacheEnabled = false; ' , APPPATH . 'Config/Optimize.php ' );
62
63
}
63
64
64
- public function testClearCache (): void
65
- {
66
- // Assume the function clearCache() is called within run() and we are testing its effect
67
- command ('optimize ' );
68
-
69
- // Check if the cache file was removed
70
- $ this ->assertFileDoesNotExist (WRITEPATH . 'cache/FactoriesCache_config ' );
71
- }
72
-
73
- public function testRemoveDevPackages (): void
74
- {
75
- // Mock passthru to simulate the removal of dev packages
76
- command ('optimize ' );
77
-
78
- // This is more of a behavioral test to ensure the command completes successfully
79
- // In a real test, you'd check the composer status or lock file
80
- $ this ->assertTrue (true ); // Placeholder assertion
81
- }
82
-
83
65
protected function assertFileContains (string $ needle , string $ filePath ): void
84
66
{
85
67
$ this ->assertFileExists ($ filePath );
You can’t perform that action at this time.
0 commit comments