assertEquals(['name' => 'New Name'], $patch->toArray()); } #[Test] public function toArrayIncludesFieldsSetToNull(): void { $patch = new BotPatch(description: null); $this->assertEquals(['description' => null], $patch->toArray()); } #[Test] public function toArrayHandlesMultipleSetFields(): void { $photoPayload = new PhotoAttachmentRequestPayload(token: 'photo123'); $patch = new BotPatch( name: 'Updated Bot', description: null, photo: $photoPayload ); $expected = [ 'name' => 'Updated Bot', 'description' => null, 'photo' => [ 'url' => null, 'token' => 'photo123', 'photos' => null, ], ]; $this->assertEquals($expected, $patch->toArray()); } #[Test] public function toArrayIsEmptyWhenNoArgumentsPassed(): void { $patch = new BotPatch(); $this->assertEmpty($patch->toArray()); } #[Test] public function toArrayFirstAndLastName(): void { $patch = new BotPatch(first_name: 'New Name', last_name: null); $this->assertEquals(['first_name' => 'New Name', 'last_name' => null], $patch->toArray()); } }