@@ -19,14 +19,14 @@ public function setUp(): void
19
19
parent ::setUp ();
20
20
21
21
DB ::connection ('mongodb ' )
22
- ->getCollection ($ this ->getCacheTableName ())
22
+ ->getCollection ($ this ->getCacheCollectionName ())
23
23
->createIndex (['key ' => 1 ], ['unique ' => true ]);
24
24
}
25
25
26
26
public function tearDown (): void
27
27
{
28
28
DB ::connection ('mongodb ' )
29
- ->getCollection ($ this ->getCacheTableName ())
29
+ ->getCollection ($ this ->getCacheCollectionName ())
30
30
->drop ();
31
31
32
32
parent ::tearDown ();
@@ -47,7 +47,7 @@ public function testPutOperationShouldNotStoreExpired()
47
47
48
48
$ store ->put ('foo ' , 'bar ' , 0 );
49
49
50
- $ this ->assertDatabaseMissing ($ this ->getCacheTableName (), ['key ' => $ this ->withCachePrefix ('foo ' )]);
50
+ $ this ->assertDatabaseMissing ($ this ->getCacheCollectionName (), ['key ' => $ this ->withCachePrefix ('foo ' )]);
51
51
}
52
52
53
53
public function testValueCanUpdateExistCache ()
@@ -80,7 +80,7 @@ public function testAddOperationShouldNotStoreExpired()
80
80
$ result = $ store ->add ('foo ' , 'bar ' , 0 );
81
81
82
82
$ this ->assertFalse ($ result );
83
- $ this ->assertDatabaseMissing ($ this ->getCacheTableName (), ['key ' => $ this ->withCachePrefix ('foo ' )]);
83
+ $ this ->assertDatabaseMissing ($ this ->getCacheCollectionName (), ['key ' => $ this ->withCachePrefix ('foo ' )]);
84
84
}
85
85
86
86
public function testAddOperationCanStoreNewCache ()
@@ -162,7 +162,7 @@ public function testGetOperationCanDeleteExpired()
162
162
163
163
$ store ->get ('foo ' );
164
164
165
- $ this ->assertDatabaseMissing ($ this ->getCacheTableName (), ['key ' => $ this ->withCachePrefix ('foo ' )]);
165
+ $ this ->assertDatabaseMissing ($ this ->getCacheCollectionName (), ['key ' => $ this ->withCachePrefix ('foo ' )]);
166
166
}
167
167
168
168
public function testForgetIfExpiredOperationCanDeleteExpired ()
@@ -173,7 +173,7 @@ public function testForgetIfExpiredOperationCanDeleteExpired()
173
173
174
174
$ store ->forgetIfExpired ('foo ' );
175
175
176
- $ this ->assertDatabaseMissing ($ this ->getCacheTableName (), ['key ' => $ this ->withCachePrefix ('foo ' )]);
176
+ $ this ->assertDatabaseMissing ($ this ->getCacheCollectionName (), ['key ' => $ this ->withCachePrefix ('foo ' )]);
177
177
}
178
178
179
179
public function testForgetIfExpiredOperationShouldNotDeleteUnExpired ()
@@ -184,7 +184,7 @@ public function testForgetIfExpiredOperationShouldNotDeleteUnExpired()
184
184
185
185
$ store ->forgetIfExpired ('foo ' );
186
186
187
- $ this ->assertDatabaseHas ($ this ->getCacheTableName (), ['key ' => $ this ->withCachePrefix ('foo ' )]);
187
+ $ this ->assertDatabaseHas ($ this ->getCacheCollectionName (), ['key ' => $ this ->withCachePrefix ('foo ' )]);
188
188
}
189
189
190
190
public function testIncrementDecrement ()
@@ -210,9 +210,9 @@ protected function getStore(): Repository
210
210
return $ repository ;
211
211
}
212
212
213
- protected function getCacheTableName (): string
213
+ protected function getCacheCollectionName (): string
214
214
{
215
- return config ('cache.stores.mongodb.table ' );
215
+ return config ('cache.stores.mongodb.collection ' );
216
216
}
217
217
218
218
protected function withCachePrefix (string $ key ): string
@@ -223,7 +223,7 @@ protected function withCachePrefix(string $key): string
223
223
protected function insertToCacheTable (string $ key , $ value , $ ttl = 60 )
224
224
{
225
225
DB ::connection ('mongodb ' )
226
- ->getCollection ($ this ->getCacheTableName ())
226
+ ->getCollection ($ this ->getCacheCollectionName ())
227
227
->insertOne ([
228
228
'key ' => $ this ->withCachePrefix ($ key ),
229
229
'value ' => $ value ,
0 commit comments