@@ 41-58 (lines=18) @@ | ||
38 | /** |
|
39 | * Test how this store handles large volumes of data (>1000 characters) |
|
40 | */ |
|
41 | public function testStoreLargeData() |
|
42 | { |
|
43 | $session = uniqid(); |
|
44 | $store = $this->getStore(); |
|
45 | ||
46 | // Test new session is blank |
|
47 | $result = $store->read($session); |
|
48 | $this->assertEmpty($result); |
|
49 | ||
50 | // Save data against session |
|
51 | $data1 = array( |
|
52 | 'Large' => str_repeat('A', 600), |
|
53 | 'Content' => str_repeat('B', 600) |
|
54 | ); |
|
55 | $store->write($session, serialize($data1)); |
|
56 | $result = $store->read($session); |
|
57 | $this->assertEquals($data1, unserialize($result)); |
|
58 | } |
|
59 | ||
60 | /** |
|
61 | * Test storage of data |
@@ 21-40 (lines=20) @@ | ||
18 | return $store; |
|
19 | } |
|
20 | ||
21 | public function testStoreLargeData() |
|
22 | { |
|
23 | $session = uniqid(); |
|
24 | $store = $this->getStore(); |
|
25 | ||
26 | // Test new session is blank |
|
27 | $result = $store->read($session); |
|
28 | $this->assertEmpty($result); |
|
29 | ||
30 | // Save data against session |
|
31 | $data1 = array( |
|
32 | 'Large' => str_repeat('A', 600), |
|
33 | 'Content' => str_repeat('B', 600) |
|
34 | ); |
|
35 | $store->write($session, serialize($data1)); |
|
36 | $result = $store->read($session); |
|
37 | ||
38 | // Cookies should not try to store data that large |
|
39 | $this->assertEmpty($result); |
|
40 | } |
|
41 | ||
42 | /** |
|
43 | * Ensure that subsequent reads without the necessary write do not report data |