2
2
3
3
namespace MongoDB \Laravel \Tests ;
4
4
5
+ use Illuminate \Database \Eloquent \Collection as EloquentCollection ;
6
+ use Illuminate \Support \Collection as LaravelCollection ;
5
7
use MongoDB \Builder \Search ;
6
- use MongoDB \Collection ;
8
+ use MongoDB \Collection as MongoDBCollection ;
7
9
use MongoDB \Driver \Exception \ServerException ;
8
10
use MongoDB \Laravel \Tests \Models \Book ;
9
11
@@ -41,7 +43,7 @@ public function setUp(): void
41
43
]);
42
44
43
45
$ collection = $ this ->getConnection ('mongodb ' )->getCollection ('books ' );
44
- assert ($ collection instanceof Collection );
46
+ assert ($ collection instanceof MongoDBCollection );
45
47
try {
46
48
$ collection ->createSearchIndex ([
47
49
'mappings ' => [
@@ -85,7 +87,7 @@ public function testEloquentBuilderSearch()
85
87
{
86
88
$ results = Book::search (Search::text ('title ' , 'systems ' ));
87
89
88
- self ::assertInstanceOf (\ Illuminate \ Database \ Eloquent \Collection ::class, $ results );
90
+ self ::assertInstanceOf (EloquentCollection ::class, $ results );
89
91
self ::assertCount (3 , $ results );
90
92
self ::assertInstanceOf (Book::class, $ results ->first ());
91
93
self ::assertSame ([
@@ -100,7 +102,7 @@ public function testDatabaseBuilderSearch()
100
102
$ results = $ this ->getConnection ('mongodb ' )->table ('books ' )
101
103
->search (Search::text ('title ' , 'systems ' ));
102
104
103
- self ::assertInstanceOf (\ Illuminate \ Support \Collection ::class, $ results );
105
+ self ::assertInstanceOf (LaravelCollection ::class, $ results );
104
106
self ::assertCount (3 , $ results );
105
107
self ::assertIsArray ($ results ->first ());
106
108
self ::assertSame ([
@@ -114,7 +116,7 @@ public function testEloquentBuilderAutocomplete()
114
116
{
115
117
$ results = Book::autocomplete ('title ' , 'system ' );
116
118
117
- self ::assertInstanceOf (\ Illuminate \ Support \Collection ::class, $ results );
119
+ self ::assertInstanceOf (LaravelCollection ::class, $ results );
118
120
self ::assertCount (3 , $ results );
119
121
self ::assertSame ([
120
122
'Operating System Concepts ' ,
@@ -128,7 +130,7 @@ public function testDatabaseBuilderAutocomplete()
128
130
$ results = $ this ->getConnection ('mongodb ' )->table ('books ' )
129
131
->autocomplete ('title ' , 'system ' );
130
132
131
- self ::assertInstanceOf (\ Illuminate \ Support \Collection ::class, $ results );
133
+ self ::assertInstanceOf (LaravelCollection ::class, $ results );
132
134
self ::assertCount (3 , $ results );
133
135
self ::assertSame ([
134
136
'Operating System Concepts ' ,
0 commit comments