X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/1c43602f4bed60a84f47735ca8bc4a399018e013..refs/pull/2902/head:/tests/TestResponse.php diff --git a/tests/TestResponse.php b/tests/TestResponse.php index 39a9d796b..79f173c9b 100644 --- a/tests/TestResponse.php +++ b/tests/TestResponse.php @@ -26,6 +26,14 @@ class TestResponse extends BaseTestResponse return $this->crawlerInstance; } + /** + * Get the HTML of the first element at the given selector. + */ + public function getElementHtml(string $selector): string + { + return $this->crawler()->filter($selector)->first()->outerHtml(); + } + /** * Assert the response contains the specified element. *