Completed
Push — master ( 53ff75...252438 )
by Markus
04:10
created

ServiceStorageTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 4
c 2
b 0
f 1
lcom 0
cbo 3
dl 0
loc 33
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testIsCalledService() 0 6 1
A testIsCalledServiceClass() 0 6 1
A testInfo() 0 10 1
A dummy() 0 4 1
1
<?php
2
namespace Mathielen\ImportEngine\Storage;
3
4
class ServiceStorageTest extends \PHPUnit_Framework_TestCase
5
{
6
7
    public function testIsCalledService()
8
    {
9
        $storage = new ServiceStorage([$this, 'dummy']);
10
11
        $this->assertTrue($storage->isCalledService($this));
12
    }
13
14
    public function testIsCalledServiceClass()
15
    {
16
        $storage = new ServiceStorage([$this, 'dummy']);
17
18
        $this->assertTrue($storage->isCalledService(self::class));
19
    }
20
21
    public function testInfo()
22
    {
23
        $storage = new ServiceStorage([$this, 'dummy']);
24
25
        $this->assertEquals(new StorageInfo([
26
            'name' => 'Mathielen\ImportEngine\Storage\ServiceStorageTest->dummy',
27
            'format' => 'Service method',
28
            'count' => 0
29
        ]), $storage->info());
30
    }
31
32
    public function dummy()
33
    {
34
        return [];
35
    }
36
}
37