From 0b2013d348f3bddb51ee6c9e1a0d0d5c5816854a Mon Sep 17 00:00:00 2001 From: Conduction Release Bot Date: Wed, 12 Aug 2026 09:52:14 +0200 Subject: [PATCH] test(feed): name the failure test after the status it actually exercises MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FeedRefreshServiceTest::testRefreshFeed500RecordsFailurePreservesItems stubs IResponse::getStatusCode() to 503 and asserts the recorded failure reason starts with "503". The name and the docblock both said 500 — a status nothing in the test produces or checks. The test itself is sound and load-bearing; only the label was wrong. REQ-FRJ-006 is written about per-feed failure tolerance generally and does not single out a status, so 503 is a faithful representative and no coverage changes hands. Renamed, docblock corrected, and the reason for the old label recorded so it is not "fixed" back. Behaviour unchanged; this is a rename plus comments. --- tests/Unit/Service/FeedRefreshServiceTest.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/Unit/Service/FeedRefreshServiceTest.php b/tests/Unit/Service/FeedRefreshServiceTest.php index efce1255b..0da75c207 100644 --- a/tests/Unit/Service/FeedRefreshServiceTest.php +++ b/tests/Unit/Service/FeedRefreshServiceTest.php @@ -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'); @@ -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