|
2 | 2 |
|
3 | 3 | declare(strict_types=1);
|
4 | 4 |
|
| 5 | +use Composer\InstalledVersions; |
5 | 6 | use Codeception\Configuration;
|
6 | 7 | use Codeception\Exception\ModuleException;
|
7 | 8 | use Codeception\Lib\Interfaces\API;
|
@@ -715,10 +716,16 @@ public function testRestExecute(string $configUrl, string $requestUrl, string $e
|
715 | 716 |
|
716 | 717 | public static function schemaAndResponse(): array
|
717 | 718 | {
|
| 719 | + if (version_compare(InstalledVersions::getVersion('justinrainbow/json-schema'), '6', '>=')) { |
| 720 | + $errorInvalidBasicSchema = 'Must have a minimum value greater than or equal to 0'; |
| 721 | + } else { |
| 722 | + $errorInvalidBasicSchema = 'Must have a minimum value of 0'; |
| 723 | + } |
| 724 | + |
718 | 725 | return [
|
719 | 726 | //schema, responsefile, valid
|
720 | 727 | ['schemas/basic-schema.json', 'responses/valid-basic-schema.json', true, ""],
|
721 |
| - ['schemas/basic-schema.json', 'responses/invalid-basic-schema.json', false, "Must have a minimum value of 0"], |
| 728 | + ['schemas/basic-schema.json', 'responses/invalid-basic-schema.json', false, $errorInvalidBasicSchema], |
722 | 729 | ['schemas/complex-schema.json', 'responses/valid-complex-schema.json', true, ""],
|
723 | 730 | ['schemas/complex-schema.json', 'responses/invalid-complex-schema.json', false, "String value found, but a boolean is required"]
|
724 | 731 | ];
|
|
0 commit comments