File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
src/Cmgmyr/Messenger/Traits Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 1515 <directory suffix =" Test.php" >./tests/</directory >
1616 </testsuite >
1717 </testsuites >
18+ <php >
19+ <env name =" APP_ENV" value =" testing" />
20+ <env name =" CACHE_DRIVER" value =" array" />
21+ <env name =" SESSION_DRIVER" value =" array" />
22+ <env name =" QUEUE_DRIVER" value =" sync" />
23+ </php >
1824</phpunit >
Original file line number Diff line number Diff line change @@ -45,6 +45,18 @@ public function threadsWithNewMessages()
4545 $ threadsWithNewMessages = [];
4646 $ participants = Participant::where ('user_id ' , $ this ->id )->lists ('last_read ' , 'thread_id ' );
4747
48+ /**
49+ * @todo: see if we can fix this more in the future.
50+ * Illuminate\Foundation is not available through composer, only in laravel/framework which
51+ * I don't want to include as a dependency for this package...it's overkill. So let's
52+ * exclude this check in the testing environment.
53+ */
54+ if (getenv ('APP_ENV ' ) != 'testing ' ) {
55+ if (!str_contains (\Illuminate \Foundation \Application::VERSION , '5.0 ' )) {
56+ $ participants = $ participants ->all ();
57+ }
58+ }
59+
4860 if ($ participants ) {
4961 $ threads = Thread::whereIn ('id ' , array_keys ($ participants ))->get ();
5062
You can’t perform that action at this time.
0 commit comments