-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHPUnit Doesn't Clear Caches #2053
Comments
Yeh, this is a known issue, but I've never really cared enough to fix it. Feel free to have a go I guess. ;) |
It's annoying af... |
|
I imagine we're also messing with our settings cache (not the same as config). |
Hmm, we could always add a listener... Like: <?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CachetHQ\Tests\Cachet;
use PHPUnit_Framework_BaseTestListener;
use PHPUnit_Framework_TestSuite;
/**
* This is the test listener class.
*
* @author Connor S. Parks <connor@connorvg.tv>
*/
class TestListener extends PHPUnit_Framework_BaseTestListener
{
/**
* A test suite ended.
*
* @since Method available since Release 2.2.0
*
* @param \PHPUnit_Framework_TestSuite $suite
*
* @return void
*/
public function endTestSuite(PHPUnit_Framework_TestSuite $suite)
{
if ($suite->getName() !== 'Cachet Test Suite') {
return;
}
foreach (glob(__DIR__.'/../bootstrap/cache/*.php') as $file) {
unlink($file);
}
}
} <listeners>
<listener class="CachetHQ\Tests\Cachet\TestListener" file="./tests/TestListener.php" />
</listeners> |
Lul |
As @GrahamCampbell noted, it actually needs all cache files cleared. Not just X or Y. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Before submitting your issue, please make sure that you've checked the checkboxes below.
php -v
.rm -rf bootstrap/cache/*
.Expected behaviour
After running
phpunit
, I expect my environment to not be mutated.Actual behaviour
PHPUnit bootstraps it's environment and never clears it's cache once completed (application stays in testing).
Steps to reproduce
vendor/bin/phpunit
/setup
artisan env
and notice you're now intesting
The text was updated successfully, but these errors were encountered: