07/06
2016
Wallogit.com
2017 © Pedro Peláez
Allows PHPUnit to test using PhantomJS.
Allows PHPUnit to test using PhantomJS., (*1)
class BasicTest extends \PHPUnit_Framework_TestCase {
public function setUp() {
$this->driver = new \PhantomJS\Driver($this);
}
public function testPage() {
$html = "<html><body>
, (*2)
";, (*3)
$this->driver->assertTrue("h1 exists", "$('h1').length == 1");
$this->driver->assertTrue("h1 value is Hi", "$('h1').html() == 'Hi'");
$this->driver->test($html);
}
}