From 3f6b688eabbc8fcebb2038c84256fc13b138b7a0 Mon Sep 17 00:00:00 2001 From: Glenn Janssens <32476955+janssensglenn@users.noreply.github.com> Date: Mon, 9 Feb 2026 11:26:38 +0100 Subject: [PATCH] Removed sources from AbstractResult::jsonSerialize --- src/Result/AbstractResult.php | 1 - tests/Result/AbstractResultTestCase.php | 19 ------------------- 2 files changed, 20 deletions(-) diff --git a/src/Result/AbstractResult.php b/src/Result/AbstractResult.php index 500d62f..303f65c 100644 --- a/src/Result/AbstractResult.php +++ b/src/Result/AbstractResult.php @@ -34,7 +34,6 @@ public function jsonSerialize(): array { return [ 'status' => $this->getStatus(), - 'sources' => $this->sources->sources(), ]; } } diff --git a/tests/Result/AbstractResultTestCase.php b/tests/Result/AbstractResultTestCase.php index 520805b..cc4b961 100644 --- a/tests/Result/AbstractResultTestCase.php +++ b/tests/Result/AbstractResultTestCase.php @@ -37,25 +37,6 @@ public function test_it_can_add_sources_to_result(): void static::assertSame('See the docs for more info', $sources[0]->content); } - public function test_it_includes_sources_in_json_serialization(): void - { - $result = $this->createResult(); - $result->sources()->add( - new Source('Docs', 'https://docs.example.com', 'See docs'), - new Source('Help', 'https://help.example.com', 'Need help') - ); - - $json = json_encode($result, JSON_THROW_ON_ERROR); - $data = json_decode($json, true, 512, JSON_THROW_ON_ERROR); - - static::assertArrayHasKey('sources', $data); - static::assertCount(2, $data['sources']); - static::assertSame('Docs', $data['sources'][0]['name']); - static::assertSame('https://docs.example.com', $data['sources'][0]['reference']); - static::assertSame('See docs', $data['sources'][0]['content']); - static::assertSame('Help', $data['sources'][1]['name']); - } - public function test_it_can_add_multiple_sources_at_once(): void { $result = $this->createResult();