Assert   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 25
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A assertArrayConstrained() 0 4 1
A constrainArray() 0 4 1
1
<?php
2
3
namespace CL\PHPUnitExtensions;
4
5
use PHPUnit_Framework_Assert;
6
7
/**
8
 * @author    Ivan Kerin <[email protected]>
9
 * @copyright 2014, Clippings Ltd.
10
 * @license   http://spdx.org/licenses/BSD-3-Clause
11
 */
12
class Assert
13
{
14
    /**
15
     * Asserts that a condition is true.
16
     *
17
     * @param  PHPUnit_Framework_Constraint[]         $constraints
18
     * @param  array                                  $array
19
     * @param  string                                 $message
20
     * @throws PHPUnit_Framework_AssertionFailedError
21
     */
22 1
    public static function assertArrayConstrained(array $constraints, array $array, $isStrict = true, $message = '')
23
    {
24 1
        PHPUnit_Framework_Assert::assertThat($array, self::constrainArray($constraints, $isStrict), $message);
25 1
    }
26
27
    /**
28
     * Returns a Constraint\ConstrainArray matcher object.
29
     *
30
     * @return Constraint\ConstrainArray
31
     */
32 1
    public static function constrainArray(array $constraints, $isStrict = true)
33
    {
34 1
        return new Constraint\ConstrainArray($constraints, $isStrict);
35
    }
36
}
37