Skip to content

Commit 6c8699c

Browse files
committed
[TEST] Warning header format has changed slightly
1 parent 9900cfd commit 6c8699c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/Elasticsearch/Tests/YamlRunnerTest.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,14 @@ public function checkForWarnings($expectedWarnings) {
397397
if ($expectedWarnings !== null) {
398398
if (isset($last['response']['headers']['Warning']) === true) {
399399
foreach ($last['response']['headers']['Warning'] as $warning) {
400-
$position = array_search($warning, $expectedWarnings);
400+
//$position = array_search($warning, $expectedWarnings);
401+
$position = false;
402+
foreach ($expectedWarnings as $index => $value) {
403+
if (stristr($warning, $value) !== false) {
404+
$position = $index;
405+
break;
406+
}
407+
}
401408
if ($position !== false) {
402409
// found the warning
403410
unset($expectedWarnings[$position]);
@@ -407,6 +414,7 @@ public function checkForWarnings($expectedWarnings) {
407414
}
408415
}
409416
if (count($expectedWarnings) > 0) {
417+
print_r($last['response']);
410418
throw new \Exception("Expected to find more warnings: ". print_r($expectedWarnings, true));
411419
}
412420
}

0 commit comments

Comments
 (0)