PathFinder::getFileSubPath()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 4
Bugs 0 Features 1
Metric Value
c 4
b 0
f 1
dl 0
loc 9
ccs 7
cts 7
cp 1
rs 9.6667
cc 1
eloc 6
nc 1
nop 0
crap 1
1
<?php
2
namespace Pumpkin\Mock;
3
4
use Pumpkin\Test\TestHelper;
5
use TRex\Parser\ClassName;
6
7
/**
8
 * Class PathFinder
9
 * @package Pumpkin\Mock
10
 * @author Raphaël Lefebvre <[email protected]>
11
 */
12
class PathFinder extends TestHelper
13
{
14
    /**
15
     * @return string
16
     */
17 7
    public function findMocksPath()
18
    {
19 7
        $pathFinder = new \Pumpkin\Test\PathFinder($this->getTest());
20 7
        return $pathFinder->findPath($this->getFileSubPath(), array('php'));
21
    }
22
23
    /**
24
     * @return string
25
     */
26 7
    private function getFileSubPath()
27
    {
28 7
        $className = new ClassName($this->getTest()->getReflectedTestMethod()->getDeclaringClass()->getName());
29 7
        return sprintf(
30 7
            '/fixtures/mocks/%s/%s',
31 7
            $className->getBaseName(),
32 7
            $this->getTest()->getReflectedTestMethod()->getName()
33 7
        );
34
    }
35
}
36