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

FormattedTest::testRun()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 9
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 12
rs 9.9666
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