From 9b1fedcffc1e71f274d35d58f79ed5b7f362aa01 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Thu, 24 Oct 2024 17:06:51 +0100 Subject: [PATCH] fix some search tests --- tests/SearchTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/SearchTest.php b/tests/SearchTest.php index a99e0a6db3..0bd2e38fa7 100644 --- a/tests/SearchTest.php +++ b/tests/SearchTest.php @@ -121,7 +121,7 @@ public function testSearchPage() { public function testSearchPageMP() { $page = $this->fetch_page([ 'q' => 'Mary Smith' ]); $this->assertStringContainsString('Mary Smith', $page); - $this->assertStringContainsString('MP, Amber Valley', $page); + $this->assertMatchesRegularExpression('/MP *for Amber Valley/', $page); } /** @@ -169,9 +169,9 @@ public function testSearchPageMultipleCons() { $page = $this->fetch_page([ 'q' => 'Liverpool' ]); $this->assertStringContainsString('MPs in constituencies matching Liverpool', $page); $this->assertStringContainsString('Susan Brown', $page); - $this->assertStringContainsString('MP, Liverpool, Riverside', $page); + $this->assertMatchesRegularExpression('/MP *for Liverpool, Riverside/', $page); $this->assertStringContainsString('Andrew Jones', $page); - $this->assertStringContainsString('MP, Liverpool, Walton', $page); + $this->assertMatchesRegularExpression('/MP *for Liverpool, Walton/', $page); } /**