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

TestCaseTrait::mapValuesWithExpected()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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