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); } /**