From 97c25cc8016c7d58eb48c1a0d1d558379b47d8b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Reichenbach?= Date: Fri, 10 Nov 2017 17:52:27 +0100 Subject: [PATCH] Add function getTestCaseByName to find test cases by name (string) --- src/Client.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/Client.php b/src/Client.php index 1889c56..6cb8d09 100644 --- a/src/Client.php +++ b/src/Client.php @@ -295,6 +295,24 @@ public function getTestCaseById($testCaseId) return false; } } + + /** + * @param int $testCaseName + * @return TestCase|bool + */ + public function getTestCaseByName($testCaseName) + { + $args = [ + 'testcasename' => $testCaseName, + ]; + $response = $this->_makeSignCall('tl.getTestCaseIDByName', $args); + + if(is_array($response) && isset($response[0])) { + return TestCase::createFromArray($this, $response[0]); + } else { + return false; + } + } /** * @param PlanTestCase $testCase