assertSame(AttachmentType::Data, $attachment->type); $this->assertSame('some_payload_from_button', $attachment->data); $expectedArray = [ 'type' => 'data', 'data' => 'some_payload_from_button', ]; $this->assertEquals($expectedArray, $attachment->toArray()); } #[Test] public function canBeCreatedFromArray(): void { $data = [ 'type' => 'data', 'data' => 'payload123', ]; $attachment = DataAttachment::fromArray($data); $this->assertInstanceOf(DataAttachment::class, $attachment); $this->assertSame(AttachmentType::Data, $attachment->type); $this->assertSame('payload123', $attachment->data); } }