1 | <?php |
||
16 | class WincacheTest extends \PHPUnit_Framework_TestCase |
||
17 | { |
||
18 | /** |
||
19 | * @var Cache\Wincache |
||
20 | * @since 1.0 |
||
21 | */ |
||
22 | private $instance; |
||
23 | |||
24 | /** |
||
25 | * Tests for the correct Psr\Cache return values. |
||
26 | * |
||
27 | * @return void |
||
28 | * |
||
29 | * @coversNothing |
||
30 | * @since 1.0 |
||
31 | */ |
||
32 | public function testPsrCache() |
||
33 | { |
||
34 | $this->assertInternalType('boolean', $this->instance->clear(), 'Checking clear.'); |
||
35 | $this->assertInstanceOf('\Psr\Cache\CacheItemInterface', $this->instance->getItem('foo'), 'Checking get.'); |
||
36 | $this->assertInternalType('array', $this->instance->getItems(array('foo')), 'Checking getMultiple.'); |
||
37 | $this->assertInternalType('boolean', $this->instance->deleteItem('foo'), 'Checking remove.'); |
||
38 | $this->assertInternalType('array', $this->instance->deleteItems(array('foo')), 'Checking removeMultiple.'); |
||
39 | |||
40 | // Create a stub for the CacheItemInterface class. |
||
41 | $stub = $this->getMockBuilder('\\Psr\\Cache\\CacheItemInterface') |
||
42 | ->getMock(); |
||
43 | |||
44 | $stub->method('get') |
||
45 | ->willReturn('bar'); |
||
46 | |||
47 | $stub->method('getKey') |
||
48 | ->willReturn('foo'); |
||
49 | |||
50 | $this->assertInternalType('boolean', $this->instance->save($stub), 'Checking save.'); |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * Tests the Joomla\Cache\Wincache::clear method. |
||
55 | * |
||
56 | * @return void |
||
57 | * |
||
58 | * @covers Joomla\Cache\Wincache::clear |
||
59 | * @since 1.0 |
||
60 | */ |
||
61 | public function testClear() |
||
62 | { |
||
63 | $this->markTestIncomplete(); |
||
64 | } |
||
65 | |||
66 | /** |
||
67 | * Tests the Joomla\Cache\Wincache::hasItem method. |
||
68 | * |
||
69 | * @return void |
||
70 | * |
||
71 | * @covers Joomla\Cache\Wincache::hasItem |
||
72 | * @since 1.0 |
||
73 | */ |
||
74 | public function testHasItem() |
||
75 | { |
||
76 | $this->markTestIncomplete(); |
||
77 | } |
||
78 | |||
79 | /** |
||
80 | * Tests the Joomla\Cache\Wincache::getItem method. |
||
81 | * |
||
82 | * @return void |
||
83 | * |
||
84 | * @covers Joomla\Cache\Wincache::getItem |
||
85 | * @since 1.0 |
||
86 | */ |
||
87 | public function testGetItem() |
||
88 | { |
||
89 | $this->markTestIncomplete(); |
||
90 | } |
||
91 | |||
92 | /** |
||
93 | * Tests the Joomla\Cache\Wincache::deleteItem method. |
||
94 | * |
||
95 | * @return void |
||
96 | * |
||
97 | * @covers Joomla\Cache\Wincache::deleteItem |
||
98 | * @since 1.0 |
||
99 | */ |
||
100 | public function testDeleteItem() |
||
101 | { |
||
102 | $this->markTestIncomplete(); |
||
103 | } |
||
104 | |||
105 | /** |
||
106 | * Tests the Joomla\Cache\Wincache::set method. |
||
107 | * |
||
108 | * @return void |
||
109 | * |
||
110 | * @covers Joomla\Cache\Wincache::set |
||
111 | * @since 1.0 |
||
112 | */ |
||
113 | public function testSet() |
||
114 | { |
||
115 | $this->markTestIncomplete(); |
||
116 | } |
||
117 | |||
118 | /** |
||
119 | * Setup the tests. |
||
120 | * |
||
121 | * @return void |
||
122 | * |
||
123 | * @since 1.0 |
||
124 | */ |
||
125 | protected function setUp() |
||
126 | { |
||
127 | parent::setUp(); |
||
128 | |||
129 | try |
||
130 | { |
||
131 | $this->instance = new Cache\Wincache; |
||
132 | } |
||
133 | catch (\Exception $e) |
||
134 | { |
||
135 | $this->markTestSkipped(); |
||
136 | } |
||
137 | } |
||
138 | } |
||
139 |