Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions tests/Unit/Service/FeedRefreshServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,18 @@ public function testRefreshFeed200ParsesAndPersists(): void
}//end testRefreshFeed200ParsesAndPersists()

/**
* `refreshFeed` on HTTP 500: records `"500 ..."` failure reason,
* `refreshFeed` on HTTP 503: records `"503 ..."` failure reason,
* leaves prior `itemsJson` untouched (REQ-FRJ-006).
*
* The stub answers 503 and the assertion pins `"503 ..."`; the name and
* this docblock both used to say 500, which named a status the body never
* exercises. REQ-FRJ-006 is written about failure tolerance generally and
* does not single out a status, so 503 is a faithful representative — the
* only thing wrong here was the label.
*
* @return void
*/
public function testRefreshFeed500RecordsFailurePreservesItems(): void
public function testRefreshFeed503RecordsFailurePreservesItems(): void
{
$existing = new FeedCache();
$existing->setFeedUrl('https://gone.example.com/rss');
Expand Down Expand Up @@ -322,7 +328,7 @@ public function testRefreshFeed500RecordsFailurePreservesItems(): void
$this->assertNotNull(actual: $captured);
$this->assertStringStartsWith(prefix: '503', string: (string) $captured->getLastFailureReason());
$this->assertCount(expectedCount: 1, haystack: $captured->decodeItems());
}//end testRefreshFeed500RecordsFailurePreservesItems()
}//end testRefreshFeed503RecordsFailurePreservesItems()

/**
* `refreshFeed` on transport exception (e.g. timeout): records
Expand Down
Loading