File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /**
4
+ * Test: Nette\Caching\Storages\SQLiteStorage tags dependency test.
5
+ */
6
+
7
+ use Nette \Caching \Cache ;
8
+ use Nette \Caching \Storages \SQLiteJournal ;
9
+ use Tester \Assert ;
10
+
11
+
12
+ require __DIR__ . '/../../bootstrap.php ' ;
13
+
14
+
15
+ if (!extension_loaded ('pdo_sqlite ' )) {
16
+ Tester \Environment::skip ('Requires PHP extension pdo_sqlite. ' );
17
+ }
18
+
19
+
20
+ $ journal = new SQLiteJournal ;
21
+
22
+ // Writing cache...
23
+ $ keys = [];
24
+ for ($ i = 0 ; $ i < 2000 ; $ i ++) {
25
+ $ keys [] = 'key ' . $ i ;
26
+ }
27
+
28
+ foreach ($ keys as $ key ) {
29
+ $ journal ->write ($ key , [
30
+ Cache::TAGS => ['one ' , 'two ' ],
31
+ ]);
32
+ }
33
+
34
+ $ journal ->write ('keyThree ' , [
35
+ Cache::TAGS => ['three ' ],
36
+ ]);
37
+
38
+ // Cleaning by tags...
39
+ $ keys = $ journal ->clean ([
40
+ Cache::TAGS => ['one ' , 'xx ' ],
41
+ ]);
42
+
43
+ Assert::same ($ keys , $ keys );
Original file line number Diff line number Diff line change 1
1
[PHP]
2
2
extension_dir = " ./ext"
3
3
extension =php_mbstring.dll
4
+ extension =php_pdo_sqlite.dll
4
5
; extension=php_memcache.dll
5
6
6
7
[Zend]
You can’t perform that action at this time.
0 commit comments