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

ApiTestCaseNew::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
/**
11
 * Class ApiTestCaseNew
12
 *
13
 * Use this class if you are using PHPUnit 8.5 or higher
14
 */
15 View Code Duplication
abstract class ApiTestCaseNew 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...
16
{
17
18
    /**
19
     * @throws GenericSwaggerException
20
     */
21
    protected function setUp(): void
22
    {
23
        if (empty($this->filePath)) {
24
            throw new GenericSwaggerException('You have to define the property $filePath');
25
        }
26
27
        $this->swaggerSchema = Schema::getInstance(file_get_contents($this->filePath));
28
    }
29
}
30