public function fillForm($selector, $data = array(), $submit = false)
    {
        $jsonData = json_encode($data);
        $jsonSubmit = ($submit) ? 'true' : 'false';

        $fragment = <<<FRAGMENT
casper.then(function () {
    this.fill('$selector', $jsonData, $jsonSubmit);
});
FRAGMENT;

        $this->script .= $fragment;

        return $this;
    }
public function fillForm($selector, $data = array(), $submit = false)
    {
        $jsonData = json_encode($data);
        $jsonSubmit = ($submit) ? 'true' : 'false';

        $fragment = <<<FRAGMENT
casper.then(function () {
    this.fill('$selector', $jsonData, $jsonSubmit);
});
FRAGMENT;

        $this->script .= $fragment;

        return $this;
    }
public function fillForm ( $ selector , $ data = array ( ) , $ submit = false ) { $ jsonData = json_encode ( $ data ) ; $ jsonSubmit = ( $ submit ) ? 'true' : 'false' ; $ fragment =  <<<FRAGMENT
casper.then(function () {
    this.fill('$selector', $jsonData, $jsonSubmit);
});
FRAGMENT ; $ this -> script .= $ fragment ; return $ this ; }
fill the form with the array of data
then submit it if submit is true

@param string $selector
@param array $data
@param string|bool $submit

@return \Browser\Casper
fill the form with the array of data then submit it if submit is true