PHP code example of glhd / dawn
1. Go to this page and download the library: Download glhd/dawn library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
glhd / dawn example snippets
class MyBrowserTest extends TestCase
{
use RefreshDatabase;
use RunsBrowserTests;
public function test_can_visit_homepage()
{
$this->openBrowser() // <-- this is Dawn
->visit('/')
->assertTitleContains('Home');
}
}
diff
-$this->browse(function ($browser) {
+$browser = $this->openBrowser();
$browser->visit('/login')
-});