assertInstanceOf(ContactAttachmentRequestPayload::class, $payload); $this->assertSame($name, $payload->name); $this->assertSame($contactId, $payload->contactId); $this->assertSame($vcfInfo, $payload->vcfInfo); $this->assertSame($vcfPhone, $payload->vcfPhone); $expectedArray = [ 'name' => $name, 'contact_id' => $contactId, 'vcf_info' => $vcfInfo, 'vcf_phone' => $vcfPhone, ]; $this->assertEquals($expectedArray, $payload->toArray()); } #[Test] public function itConstructsWithNullablePropertiesAndSerializesCorrectly(): void { $name = 'Jane Doe'; $vcfPhone = 'TEL:+79876543210'; $payload = new ContactAttachmentRequestPayload( name: $name, vcfPhone: $vcfPhone, ); $this->assertSame($name, $payload->name); $this->assertNull($payload->contactId); $this->assertNull($payload->vcfInfo); $this->assertSame($vcfPhone, $payload->vcfPhone); $expectedArray = [ 'name' => $name, 'contact_id' => null, 'vcf_info' => null, 'vcf_phone' => $vcfPhone, ]; $this->assertEquals($expectedArray, $payload->toArray()); } #[Test] public function itConstructsWithAllNullsAndSerializesCorrectly(): void { $payload = new ContactAttachmentRequestPayload(); $this->assertNull($payload->name); $this->assertNull($payload->contactId); $this->assertNull($payload->vcfInfo); $this->assertNull($payload->vcfPhone); $expectedArray = [ 'name' => null, 'contact_id' => null, 'vcf_info' => null, 'vcf_phone' => null, ]; $this->assertEquals($expectedArray, $payload->toArray()); } }