Completed
Push — develop ( 0bb09c...6377aa )
by Michal
02:49
created

TestCaseTrait   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
cbo 0
dl 0
loc 16
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A prepareDataForProvider() 0 4 1
A mapValuesWithExpected() 0 4 1
A diag() 0 4 1
1
<?php
2
/*
3
 * This file is part of the ILess
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
trait TestCaseTrait {
10
    protected function prepareDataForProvider($values, $expected)
11
    {
12
        return array_map([$this, 'mapValuesWithExpected'], $values, $expected);
13
    }
14
15
    protected function mapValuesWithExpected($values, $expected)
16
    {
17
        return [$values, $expected];
18
    }
19
20
    protected function diag($message)
21
    {
22
        echo "\n" . $message . "\n";
23
    }
24
}
25
26
if(class_exists('PHPUnit_Framework_TestCase')) {
27
    class Test_TestCase extends \PHPUnit_Framework_TestCase {
28
        use TestCaseTrait;
29
    }
30
} else {
31
    // phpunit 6+
32
    class TestCase extends \PHPUnit\Framework\TestCase {
33
        use TestCaseTrait;
34
    }
35
}
36