PhileToPsr16CacheAdapterTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 9
c 1
b 0
f 1
dl 0
loc 15
ccs 9
cts 9
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testSlug() 0 13 1
1
<?php
2
3
namespace Phile\Plugin\Phile\PhpFastCache\Tests;
4
5
use Phile\Plugin\Phile\PhpFastCache\PhileToPsr16CacheAdapter;
6
use Phpfastcache\Helper\Psr16Adapter;
7
use Phile\Test\TestCase;
8
9
/**
10
 * Tests for PhileToPsr16CacheAdapter class
11
 *
12
 * @link    https://philecms.github.io
13
 * @license http://opensource.org/licenses/MIT
14
 * @package Phile\Plugin\Phile\PhpFastCache\Tests
15
 */
16
class PhileToPsr16CacheAdapterTest extends TestCase
17
{
18 1
    public function testSlug()
19
    {
20 1
        $this->createPhileCore()->bootstrap();
21
22 1
        $psr16Cache = new Psr16Adapter('memstatic');
23 1
        $adapter = new PhileToPsr16CacheAdapter($psr16Cache);
24
25 1
        $adapter->set("{}()\/:@", 'foo');
26 1
        $this->assertSame('foo', $adapter->get("{}()\/:@"));
27
28 1
        $adapter->set('}foo', 'bar');
29 1
        $adapter->set('{foo', 'baz');
30 1
        $this->assertSame('bar', $adapter->get('}foo'));
31
    }
32
}
33