Completed
Pull Request — master (#33)
by Joao
06:58
created

ApiTestCase::setUp()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 8
Ratio 100 %

Importance

Changes 0
Metric Value
dl 8
loc 8
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace ByJG\ApiTools;
4
5
use ByJG\ApiTools\Base\BaseTestCase;
6
use ByJG\ApiTools\Base\Schema;
7
use ByJG\ApiTools\Exception\GenericSwaggerException;
8
use GuzzleHttp\GuzzleException;
9
10 View Code Duplication
abstract class ApiTestCase extends BaseTestCase
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
{
12
13
    /**
14
     * @throws GenericSwaggerException
15
     */
16
    protected function setUp()
17
    {
18
        if (empty($this->filePath)) {
19
            throw new GenericSwaggerException('You have to define the property $filePath');
20
        }
21
22
        $this->swaggerSchema = Schema::getInstance(file_get_contents($this->filePath));
23
    }
24
}
25