assertSame(['status' => 'ok'], $status->toArray()); } #[Test] public function it_serializes_not_configured_status(): void { $status = new ProviderStatus('github', ProviderStatusType::NotConfigured); $this->assertSame(['status' => 'not_configured'], $status->toArray()); } #[Test] public function it_serializes_error_status_with_code_and_message(): void { $status = new ProviderStatus('github', ProviderStatusType::Error, ProviderErrorCode::AuthFailed, 'Token expired'); $this->assertSame([ 'status' => 'error', 'error' => 'auth_failed', 'message' => 'Token expired', ], $status->toArray()); } #[Test] public function it_omits_null_error_fields_from_array(): void { $status = new ProviderStatus('github', ProviderStatusType::Ok); $array = $status->toArray(); $this->assertArrayNotHasKey('error', $array); $this->assertArrayNotHasKey('message', $array); } #[Test] public function it_exposes_typed_status_property(): void { $status = new ProviderStatus('github', ProviderStatusType::Error, ProviderErrorCode::Unknown, 'msg'); $this->assertSame(ProviderStatusType::Error, $status->status); $this->assertSame(ProviderErrorCode::Unknown, $status->error); } }