From ad86f9186b5b7b9641a20a1b993058811c9c40a7 Mon Sep 17 00:00:00 2001 From: Zachary Tong Date: Tue, 14 Nov 2017 15:37:31 +0000 Subject: [PATCH] [TEST] Add support for `bad_request` in yaml runner --- tests/Elasticsearch/Tests/YamlRunnerTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/Elasticsearch/Tests/YamlRunnerTest.php b/tests/Elasticsearch/Tests/YamlRunnerTest.php index 4918bcfb8..3537654c4 100644 --- a/tests/Elasticsearch/Tests/YamlRunnerTest.php +++ b/tests/Elasticsearch/Tests/YamlRunnerTest.php @@ -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') {