@@ 10-24 (lines=15) @@ | ||
7 | use ByJG\ApiTools\Exception\GenericSwaggerException; |
|
8 | use GuzzleHttp\GuzzleException; |
|
9 | ||
10 | abstract class ApiTestCase extends BaseTestCase |
|
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 |
@@ 15-29 (lines=15) @@ | ||
12 | * |
|
13 | * Use this class if you are using PHPUnit 8.5 or higher |
|
14 | */ |
|
15 | abstract class ApiTestCaseNew extends BaseTestCase |
|
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 |