Passed
Pull Request — master (#653)
by Aleksei
05:48
created

CacheBootloaderTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 22
rs 10
c 1
b 0
f 0
wmc 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Framework\Cache;
6
7
use Psr\SimpleCache\CacheInterface;
8
use Spiral\Cache\CacheManager;
9
use Spiral\Cache\CacheStorageProviderInterface;
10
use Spiral\Cache\Storage\ArrayStorage;
11
use Spiral\Cache\Storage\FileStorage;
12
use Spiral\Tests\Framework\BaseTest;
13
14
final class CacheBootloaderTest extends BaseTest
15
{
16
    /** @var \Spiral\App\TestApp */
17
    private $app;
18
19
    protected function setUp(): void
20
    {
21
        parent::setUp();
22
23
        $this->app = $this->makeApp();
24
    }
25
26
    public function testBindings()
27
    {
28
        $this->assertInstanceOf(ArrayStorage::class, $this->app->get(CacheInterface::class));
29
        $this->assertInstanceOf(CacheManager::class, $this->app->get(CacheStorageProviderInterface::class));
30
    }
31
32
    public function testGetsStorageByAlias()
33
    {
34
        $manager = $this->app->get(CacheStorageProviderInterface::class);
35
        $this->assertInstanceOf(FileStorage::class, $manager->storage('user-data'));
36
    }
37
}
38