MappingRepositoryTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_generateCache() 0 11 1
1
<?php
2
3
namespace Nip\Records\Tests\Mapping;
4
5
use Nip\Records\Mapping\MappingData;
6
use Nip\Records\Mapping\MappingRepository;
7
use Nip\Records\Tests\AbstractTest;
8
9
/**
10
 * Class MappingRepositoryTest
11
 * @package Nip\Records\Tests\Mapping
12
 */
13
class MappingRepositoryTest extends AbstractTest
14
{
15
    public function test_generateCache()
16
    {
17
        $repository = new MappingRepository();
18
        $data = new MappingData();
19
        $data->setTable('test');
20
        $repository->set('test', $data);
21
22
        $cache = $repository->generateCache();
23
        self::assertSame(
24
            'a:1:{s:4:"test";C:31:"Nip\Records\Mapping\MappingData":122:{a:6:{s:5:"table";s:4:"test";s:5:"model";N;s:10:"controller";N;s:14:"tableStructure";N;s:6:"fields";N;s:10:"bootTraits";N;}}}',
25
            $cache
26
        );
27
    }
28
}
29