ObjectUtilsTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testGetConstants() 0 12 1
1
<?php
2
namespace Bedd\Common;
3
4
class TestClassA
5
{
6
    const MY_CONST = 1;
7
}
8
9
/**
10
 * ObjectUtilsTest
11
 */
12
class ObjectUtilsTest extends TestCase
13
{
14
    /**
15
     * Test for Bedd\Common\ObjectUtils::getConstants
16
     */
17
    public function testGetConstants()
18
    {
19
        $this->assertEquals([
20
            'SECONDS_PER_MINUTE' => 60,
21
            'SECONDS_PER_HOUR' => 3600,
22
            'SECONDS_PER_DAY' => 86400,
23
            'SECONDS_PER_WEEK' => 604800,
24
            'SECONDS_PER_MONTH' => 2592000,
25
            'SECONDS_PER_YEAR' => 31536000,
26
        ], ObjectUtils::getConstants(DateTimeUtils::class));
27
        $this->assertEquals(['MY_CONST' => 1], ObjectUtils::getConstants(new TestClassA));
28
    }
29
}
30