Code Duplication    Length = 18-20 lines in 2 locations

tests/AbstractTest.php 1 location

@@ 46-63 (lines=18) @@
43
    /**
44
     * Test how this store handles large volumes of data (>1000 characters)
45
     */
46
    public function testStoreLargeData()
47
    {
48
        $session = uniqid();
49
        $store = $this->getStore();
50
51
        // Test new session is blank
52
        $result = $store->read($session);
53
        $this->assertEmpty($result);
54
55
        // Save data against session
56
        $data1 = array(
57
            'Large' => str_repeat('A', 600),
58
            'Content' => str_repeat('B', 600)
59
        );
60
        $store->write($session, serialize($data1));
61
        $result = $store->read($session);
62
        $this->assertEquals($data1, unserialize($result));
63
    }
64
65
    /**
66
     * Test storage of data

tests/CookieStoreTest.php 1 location

@@ 22-41 (lines=20) @@
19
        return $store;
20
    }
21
22
    public function testStoreLargeData()
23
    {
24
        $session = uniqid();
25
        $store = $this->getStore();
26
27
        // Test new session is blank
28
        $result = $store->read($session);
29
        $this->assertEmpty($result);
30
31
        // Save data against session
32
        $data1 = array(
33
            'Large' => str_repeat('A', 600),
34
            'Content' => str_repeat('B', 600)
35
        );
36
        $store->write($session, serialize($data1));
37
        $result = $store->read($session);
38
39
        // Cookies should not try to store data that large
40
        $this->assertEmpty($result);
41
    }
42
43
    /**
44
     * Ensure that subsequent reads without the necessary write do not report data