Skip to content

Commit 3f6b688

Browse files
committed
Removed sources from AbstractResult::jsonSerialize
1 parent 2267f99 commit 3f6b688

2 files changed

Lines changed: 0 additions & 20 deletions

File tree

src/Result/AbstractResult.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public function jsonSerialize(): array
3434
{
3535
return [
3636
'status' => $this->getStatus(),
37-
'sources' => $this->sources->sources(),
3837
];
3938
}
4039
}

tests/Result/AbstractResultTestCase.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,6 @@ public function test_it_can_add_sources_to_result(): void
3737
static::assertSame('See the docs for more info', $sources[0]->content);
3838
}
3939

40-
public function test_it_includes_sources_in_json_serialization(): void
41-
{
42-
$result = $this->createResult();
43-
$result->sources()->add(
44-
new Source('Docs', 'https://docs.example.com', 'See docs'),
45-
new Source('Help', 'https://help.example.com', 'Need help')
46-
);
47-
48-
$json = json_encode($result, JSON_THROW_ON_ERROR);
49-
$data = json_decode($json, true, 512, JSON_THROW_ON_ERROR);
50-
51-
static::assertArrayHasKey('sources', $data);
52-
static::assertCount(2, $data['sources']);
53-
static::assertSame('Docs', $data['sources'][0]['name']);
54-
static::assertSame('https://docs.example.com', $data['sources'][0]['reference']);
55-
static::assertSame('See docs', $data['sources'][0]['content']);
56-
static::assertSame('Help', $data['sources'][1]['name']);
57-
}
58-
5940
public function test_it_can_add_multiple_sources_at_once(): void
6041
{
6142
$result = $this->createResult();

0 commit comments

Comments
 (0)