diff --git a/src/Browser.php b/src/Browser.php index 16bdafe64..1a56c2095 100644 --- a/src/Browser.php +++ b/src/Browser.php @@ -382,7 +382,7 @@ public function storeConsoleLog($name) * @param string $name * @return $this */ - public function source($name) + public function storeSource($name) { $source = $this->driver->getPageSource(); diff --git a/tests/BrowserTest.php b/tests/BrowserTest.php index 59c5446d9..a62b06678 100644 --- a/tests/BrowserTest.php +++ b/tests/BrowserTest.php @@ -215,11 +215,11 @@ public function test_can_enable_fit_on_failure() $this->assertTrue($this->browser->fitOnFailure); } - public function test_source() + public function test_source_code_can_be_stored() { $this->driver->shouldReceive('getPageSource')->andReturn('source content'); Browser::$storeSourceAt = sys_get_temp_dir(); - $this->browser->source( + $this->browser->storeSource( $name = 'screenshot-01' ); $this->assertFileExists(Browser::$storeSourceAt.'/'.$name.'.txt');