SupportTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 5
dl 0
loc 28
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testConfig() 0 8 1
A testTimestamps() 0 10 1
1
<?php
2
3
namespace Spiral\Tests\LogViewer;
4
5
use Spiral\LogViewer\Config;
6
use Spiral\LogViewer\Entities\LogTimestamp;
7
use Spiral\LogViewer\Helpers\Timestamps;
8
use Spiral\Tests\BaseTest;
9
10
class SupportTest extends BaseTest
11
{
12
    /**
13
     * Test config class.
14
     */
15
    public function testConfig()
16
    {
17
        /** @var Config $config */
18
        $config = $this->container->get(Config::class);
19
20
        $this->assertNotEmpty($config->directories());
21
        $this->assertTrue(is_array($config->directories()));
22
    }
23
24
    /**
25
     * Test timestamps helper.
26
     */
27
    public function testTimestamps()
28
    {
29
        /** @var Timestamps $names */
30
        $names = $this->container->get(Timestamps::class);
31
32
        $timestamp = new LogTimestamp(new \DateTime(), []);
33
34
        $this->assertEquals($timestamp, $names->getTime($timestamp));
35
        $this->assertNotEquals('filename', $names->getTime($timestamp, true));
36
    }
37
}