Skip to content

Commit 974c3c6

Browse files
committed
[TEST] Add support for bad_request in yaml runner
1 parent 95a2c32 commit 974c3c6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/Elasticsearch/Tests/YamlRunnerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,8 @@ private function assertException(\Exception $exception, $expectedError, $testNam
720720
{
721721
if (is_string($expectedError) && preg_match('#^/.+?/$#', $expectedError)) {
722722
$this->assertRegExp($expectedError, $exception->getMessage(), 'Failed to catch error in test ' . $testName);
723+
} elseif ($exception instanceof BadRequest400Exception && $expectedError === 'bad_request') {
724+
$this->assertTrue(true);
723725
} elseif ($exception instanceof Missing404Exception && $expectedError === 'missing') {
724726
$this->assertTrue(true);
725727
} elseif ($exception instanceof Conflict409Exception && $expectedError === 'conflict') {

0 commit comments

Comments
 (0)