BuildR_TestCase::assertConstantDefined()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php namespace BuildR\TestTools;
2
3
use BuildR\TestTools\Asserts\IsConstantDefinedConstraint;
4
use BuildR\TestTools\Asserts\IsConstantValueEqualsConstraint;
5
use BuildR\TestTools\Traits\FakeDataGenerator;
6
use BuildR\TestTools\Traits\ReflectionUtilities;
7
use PHPUnit_Framework_TestCase;
8
9
/**
10
 * Test case that use the traits for testing that this package provides
11
 *
12
 * BuildR PHP Framework
13
 *
14
 * @author Zoltán Borsos <[email protected]>
15
 * @package TestTools
16
 *
17
 * @copyright    Copyright 2016, Zoltán Borsos.
18
 * @license      https://github.com/BuildrPHP/Test-Tools/blob/master/LICENSE.md
19
 * @link         https://github.com/BuildrPHP/Test-Tools
20
 */
21
//@codingStandardsIgnoreStart
22
class BuildR_TestCase extends PHPUnit_Framework_TestCase {
23
//@codingStandardsIgnoreEnd
24
25
    use FakeDataGenerator;
26
    use ReflectionUtilities;
27
28
    /**
29
     * Assert that the given constant is defined in the global namespace
30
     *
31
     * @param string $constantName
32
     *
33
     * @codeCoverageIgnore
34
     */
35
    public function assertConstantDefined($constantName) {
36
        self::assertThat($constantName, (new IsConstantDefinedConstraint()));
37
    }
38
39
    /**
40
     * Assert that the given constant value is equals with thi given expectation
41
     *
42
     * @param string $constantName
43
     * @param string $expected
44
     *
45
     * @codeCoverageIgnore
46
     */
47
    public function assertConstantEquals($constantName, $expected) {
48
        self::assertThat($constantName, (new IsConstantValueEqualsConstraint($expected)));
49
    }
50
51
}
52