Passed
Push — master ( 380356...2e1f1e )
by Petr
10:45
created

FormattedTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 17
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testRun() 0 12 1
1
<?php
2
3
namespace CacheTests;
4
5
6
use kalanis\kw_cache\Cache\Formatted;
7
use kalanis\kw_cache\CacheException;
8
use kalanis\kw_cache\Format\Raw;
9
use kalanis\kw_cache\Simple;
10
11
12
class FormattedTest extends ACacheTest
13
{
14
    /**
15
     * @throws CacheException
16
     */
17
    public function testRun(): void
18
    {
19
        $lib = new Formatted(new Simple\Variable(), new Raw());
20
        $lib->init('');
21
22
        $this->assertFalse($lib->exists());
23
        $this->assertEquals('', $lib->get());
24
        $this->assertTrue($lib->set(static::TESTING_CONTENT));
25
        $this->assertTrue($lib->exists());
26
        $this->assertEquals(static::TESTING_CONTENT, $lib->get());
27
        $lib->clear();
28
        $this->assertFalse($lib->exists());
29
    }
30
}
31