Completed
Pull Request — master (#69)
by Raúl
02:33 queued 01:19
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\Exception\ParseException;
7
use Sepia\PoParser\Parser;
8
9
abstract class AbstractFixtureTest extends TestCase
10
{
11
    /** @var string */
12
    protected $resourcesPath;
13
14
    public function setUp()
15
    {
16
        $this->resourcesPath = dirname(__DIR__).'/fixtures/';
17
    }
18
19
    /**
20
     * @param string $file
21
     *
22
     * @return \Sepia\PoParser\Catalog
23
     */
24
    protected function parseFile($file)
25
    {
26
        try {
27
            return Parser::parseFile($this->resourcesPath.$file);
28
        } catch (\Exception $e) {
29
            $this->fail($e->getMessage());
30
        }
31
    }
32
}
33