Completed
Pull Request — master (#69)
by Raúl
02:28 queued 01:15
created

AbstractFixtureTest::parseFile()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
namespace Sepia\Test;
4
5
use PHPUnit\Framework\TestCase;
6
use Sepia\PoParser\Parser;
7
8
abstract class AbstractFixtureTest extends TestCase
9
{
10
    /** @var string */
11
    protected $resourcesPath;
12
13
    public function setUp()
14
    {
15
        $this->resourcesPath = dirname(__DIR__).'/fixtures/';
16
    }
17
18
    /**
19
     * @param string $file
20
     *
21
     * @return \Sepia\PoParser\Catalog
22
     */
23
    protected function parseFile($file)
24
    {
25
        try {
26
            return Parser::parseFile($this->resourcesPath.$file);
27
        } catch (\Exception $e) {
28
            $this->fail($e->getMessage());
29
        }
30
    }
31
}
32