tests: code review of acceptance tests

This commit is contained in:
Phil Davis
2024-04-29 13:47:08 +05:45
parent aa26c451f7
commit 86b931f176
24 changed files with 161 additions and 238 deletions
@@ -195,12 +195,12 @@ class SearchContext implements Context {
null,
true
);
foreach ($elementRows as $index => $expectedFile) {
foreach ($elementRows as $expectedFile) {
$filename = $expectedFile[0];
$content = $foundEntries[$filename];
// Extract the content between the <mark> tags
preg_match('/<mark>(.*?)<\/mark>/s', $content, $matches);
$actualContent = isset($matches[1]) ? $matches[1] : '';
$actualContent = $matches[1] ?? '';
// Remove any leading/trailing whitespace for comparison
$actualContent = trim($actualContent);