Completed
Push — master ( 4783ce...1821eb )
by Dennis
03:38
created

BaseCase::assertSame()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 2
1
<?php
2
3
/**
4
 * (c) Dennis Meckel
5
 *
6
 * For the full copyright and license information,
7
 * please view the LICENSE file that was distributed with this source code.
8
 */
9
10
namespace Rayne\wz2008\Graph\Benchmark;
11
12
use RuntimeException;
13
14
abstract class BaseCase
15
{
16
    /**
17
     * @param $expected
18
     * @param $actual
19
     * @throws RuntimeException
20
     */
21
    protected function assertSame($expected, $actual)
22
    {
23
        if ($expected !== $actual) {
24
            throw new RuntimeException(sprintf('Expected `%s` but got `%s`.', $expected, $actual));
25
        }
26
    }
27
28
    /**
29
     * @param string $file
30
     * @return string
31
     */
32
    protected function getAssetFile($file)
33
    {
34
        return dirname(__DIR__) . '/assets/' . $file;
35
    }
36
}
37