Skip to content

Commit 6f86336

Browse files
committed
tests: SQLiteJournal 'Too many variables' bug test added [Ref #25]
1 parent 4649143 commit 6f86336

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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);

tests/php-win.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[PHP]
22
extension_dir = "./ext"
33
extension=php_mbstring.dll
4+
extension=php_pdo_sqlite.dll
45
;extension=php_memcache.dll
56

67
[Zend]

0 commit comments

Comments
 (0)