Php 如何编写一个Behat步骤来捕获Goutte驱动程序的屏幕截图?

Php 如何编写一个Behat步骤来捕获Goutte驱动程序的屏幕截图?,php,screenshot,behat,goutte,Php,Screenshot,Behat,Goutte,我需要将HTML保存在某个文件中,以便在浏览器中打开 /** * @Then /^show me the page$/ */ public function show_me_the_page() { $html = $this->getSession()->getDriver()->getContent(); file_put_contents('/tmp/behat_page.html', $html); }

我需要将HTML保存在某个文件中,以便在浏览器中打开

/**
 * @Then /^show me the page$/
 */
public function show_me_the_page() {

    $html = $this->getSession()->getDriver()->getContent();
    file_put_contents('/tmp/behat_page.html', $html);
}