-
Notifications
You must be signed in to change notification settings - Fork 24k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ebc6f6e
commit 071efc0
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace Tests; | ||
|
||
use PHPUnit\Framework\TestSuite; | ||
use PHPUnit\Framework\TestListener; | ||
use Illuminate\Contracts\Console\Kernel; | ||
use PHPUnit\Framework\TestListenerDefaultImplementation; | ||
|
||
class Listener implements TestListener | ||
{ | ||
use CreatesApplication, TestListenerDefaultImplementation; | ||
|
||
/** | ||
* Indicates if the listener has already run. | ||
* | ||
* @var bool | ||
*/ | ||
protected $alreadyRun = false; | ||
|
||
/** | ||
* Called at the start of the test suite. | ||
* | ||
* @param \PHPUnit\Framework\TestSuite $suite | ||
* @return void | ||
*/ | ||
public function startTestSuite(TestSuite $suite): void | ||
{ | ||
if ($this->alreadyRun) { | ||
return; | ||
} | ||
|
||
$this->createApplication() | ||
->make(Kernel::class) | ||
->call('config:cache'); | ||
|
||
$this->alreadyRun = true; | ||
} | ||
} |