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

BaseCase   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A assertSame() 0 6 2
A getAssetFile() 0 4 1
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