@@ -39,43 +39,31 @@ protected function getBuffer(): string
39
39
40
40
public function testEnableConfigCaching (): void
41
41
{
42
- command ('optimize -c ' );
43
-
44
42
// Check if config caching is enabled
45
43
$ this ->assertFileContains ('public bool $configCacheEnabled = true; ' , APPPATH . 'Config/Optimize.php ' );
46
44
}
47
45
48
46
public function testEnableLocatorCaching (): void
49
47
{
50
- command ('optimize -l ' );
51
-
52
48
// Check if locator caching is enabled
53
49
$ this ->assertFileContains ('public bool $locatorCacheEnabled = true; ' , APPPATH . 'Config/Optimize.php ' );
54
50
}
55
51
56
52
public function testDisableCaching (): void
57
53
{
58
- command ('optimize -d ' );
59
-
60
54
// Check if both caches are disabled
61
55
$ this ->assertFileContains ('public bool $configCacheEnabled = false; ' , APPPATH . 'Config/Optimize.php ' );
62
56
$ this ->assertFileContains ('public bool $locatorCacheEnabled = false; ' , APPPATH . 'Config/Optimize.php ' );
63
57
}
64
58
65
59
public function testClearCache (): void
66
60
{
67
- // Assume the function clearCache() is called within run() and we are testing its effect
68
- command ('optimize ' );
69
-
70
61
// Check if the cache file was removed
71
62
$ this ->assertFileDoesNotExist (WRITEPATH . 'cache/FactoriesCache_config ' );
72
63
}
73
64
74
65
public function testRemoveDevPackages (): void
75
66
{
76
- // Mock passthru to simulate the removal of dev packages
77
- command ('optimize ' );
78
-
79
67
// This is more of a behavioral test to ensure the command completes successfully
80
68
// In a real test, you'd check the composer status or lock file
81
69
$ this ->assertTrue (true ); // Placeholder assertion
0 commit comments