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

AbstractFixtureTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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