Skip to content

Commit

Permalink
[TEST] Add support for bad_request in yaml runner
Browse files Browse the repository at this point in the history
  • Loading branch information
polyfractal committed Nov 14, 2017
1 parent 885bfea commit ad86f91
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/Elasticsearch/Tests/YamlRunnerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,8 @@ private function assertException(\Exception $exception, $expectedError, $testNam
{
if (is_string($expectedError) && preg_match('#^/.+?/$#', $expectedError)) {
$this->assertRegExp($expectedError, $exception->getMessage(), 'Failed to catch error in test ' . $testName);
} elseif ($exception instanceof BadRequest400Exception && $expectedError === 'bad_request') {
$this->assertTrue(true);
} elseif ($exception instanceof Missing404Exception && $expectedError === 'missing') {
$this->assertTrue(true);
} elseif ($exception instanceof Conflict409Exception && $expectedError === 'conflict') {
Expand Down

0 comments on commit ad86f91

Please sign in to comment.