diff --git a/src/Model/IndustryClassificationsResponse.php b/src/Model/IndustryClassificationsResponse.php index 5db5718..a44d450 100644 --- a/src/Model/IndustryClassificationsResponse.php +++ b/src/Model/IndustryClassificationsResponse.php @@ -12,5 +12,5 @@ final class IndustryClassificationsResponse extends AbstractResponse public string $code; #[SerializedName('classificationDescription')] - public string $description; + public ?string $description; } diff --git a/tests/Model/IndustryClassificationResponseTest.php b/tests/Model/IndustryClassificationResponseTest.php new file mode 100644 index 0000000..e9b41f2 --- /dev/null +++ b/tests/Model/IndustryClassificationResponseTest.php @@ -0,0 +1,57 @@ +valid($data, IndustryClassificationsResponse::class); + + static::assertSame('C121220', $parsed->code); + static::assertSame('Breweries', $parsed->description); + } + + public function testValidModelWithoutDescription(): void + { + $data = <<valid($data, IndustryClassificationsResponse::class); + + static::assertSame('C121220', $parsed->code); + static::assertNull($parsed->description); + } + + public function testInvalidModel(): void + { + $data = <<invalid($data, IndustryClassificationsResponse::class); + } +}