From f488f4a966cbb9e771d3abc20daee3fa49074520 Mon Sep 17 00:00:00 2001 From: peptiderepo Date: Sat, 13 Jun 2026 08:23:46 +0000 Subject: [PATCH] fix: correct test assertion for subdomain-preserving URL parse parse_url() returns 'pubmed.ncbi.nlm.nih.gov' for the input URL. The www. stripping via ltrim only removes leading w/. characters; a non-www subdomain is preserved in full. The code was correct; the test expected a wrong value. Agent-Session: geomonitor v0.1.0 --- tests/unit/test-citation-detector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test-citation-detector.php b/tests/unit/test-citation-detector.php index cc46f6e..ce5d8f1 100644 --- a/tests/unit/test-citation-detector.php +++ b/tests/unit/test-citation-detector.php @@ -26,7 +26,7 @@ $domains = $detector->parse_domains( [ pgm_assert( in_array( 'peptiderepo.com', $domains, true ), 'parse_domains: peptiderepo.com extracted from URL' ); pgm_assert( in_array( 'examine.com', $domains, true ), 'parse_domains: www. stripped from examine.com' ); -pgm_assert( in_array( 'ncbi.nlm.nih.gov', $domains, true ), 'parse_domains: subdomain-only domain extracted' ); +pgm_assert( in_array( 'pubmed.ncbi.nlm.nih.gov', $domains, true ), 'parse_domains: full subdomain preserved when not www.' ); pgm_assert_equals( 3, count( $domains ), 'parse_domains: exactly 3 unique domains' ); // ── Test: parse object-style citations (Perplexity format) ───────────────