File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 22
33namespace Illuminate \Tests \Integration \Queue ;
44
5+ use Illuminate \Foundation \Testing \Concerns \InteractsWithRedis ;
56use Illuminate \Foundation \Testing \DatabaseMigrations ;
67use Orchestra \Testbench \TestCase ;
78
89abstract class QueueTestCase extends TestCase
910{
10- use DatabaseMigrations;
11+ use DatabaseMigrations, InteractsWithRedis ;
1112
1213 /**
1314 * The current database driver.
@@ -27,6 +28,24 @@ protected function defineEnvironment($app)
2728 $ this ->driver = $ app ['config ' ]->get ('queue.default ' , 'sync ' );
2829 }
2930
31+ #[\Override]
32+ protected function setUp (): void
33+ {
34+ $ this ->afterApplicationCreated (function () {
35+ if ($ this ->getQueueDriver () === 'redis ' ) {
36+ $ this ->setUpRedis ();
37+ }
38+ });
39+
40+ $ this ->beforeApplicationDestroyed (function () {
41+ if ($ this ->getQueueDriver () === 'redis ' ) {
42+ $ this ->tearDownRedis ();
43+ }
44+ });
45+
46+ parent ::setUp ();
47+ }
48+
3049 /**
3150 * Run queue worker command.
3251 *
You can’t perform that action at this time.
0 commit comments