Skip to content

Commit

Permalink
revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
warcooft committed Jul 29, 2024
1 parent 9a89389 commit b80171e
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions tests/system/Commands/Utilities/OptimizeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected function getBuffer(): string
public function testEnableConfigCaching(): void
{
command('optimize -c');

// Check if config caching is enabled
$this->assertFileContains('public bool $configCacheEnabled = true;', APPPATH . 'Config/Optimize.php');
}
Expand All @@ -56,30 +56,12 @@ public function testEnableLocatorCaching(): void
public function testDisableCaching(): void
{
command('optimize -d');

// Check if both caches are disabled
$this->assertFileContains('public bool $configCacheEnabled = false;', APPPATH . 'Config/Optimize.php');
$this->assertFileContains('public bool $locatorCacheEnabled = false;', APPPATH . 'Config/Optimize.php');
}

public function testClearCache(): void
{
// Assume the function clearCache() is called within run() and we are testing its effect
command('optimize');

// Check if the cache file was removed
$this->assertFileDoesNotExist(WRITEPATH . 'cache/FactoriesCache_config');
}

public function testRemoveDevPackages(): void
{
// Mock passthru to simulate the removal of dev packages
command('optimize');

// This is more of a behavioral test to ensure the command completes successfully
// In a real test, you'd check the composer status or lock file
$this->assertTrue(true); // Placeholder assertion
}

protected function assertFileContains(string $needle, string $filePath): void
{
$this->assertFileExists($filePath);
Expand Down

0 comments on commit b80171e

Please sign in to comment.