Completed
Push — master ( c24d4c...96117c )
by Sven
02:34
created

ObjectUtilsTest::testGetConstants()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 10
nc 1
nop 0
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 \PHPUnit_Framework_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