repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
partition
stringclasses
1 value
mrclay/minify
lib/HTTP/Encoder.php
HTTP_Encoder.isBuggyIe
public static function isBuggyIe() { if (empty($_SERVER['HTTP_USER_AGENT'])) { return false; } $ua = $_SERVER['HTTP_USER_AGENT']; // quick escape for non-IEs if (0 !== strpos($ua, 'Mozilla/4.0 (compatible; MSIE ') || false !== strpos($ua, 'Opera')) { ...
php
public static function isBuggyIe() { if (empty($_SERVER['HTTP_USER_AGENT'])) { return false; } $ua = $_SERVER['HTTP_USER_AGENT']; // quick escape for non-IEs if (0 !== strpos($ua, 'Mozilla/4.0 (compatible; MSIE ') || false !== strpos($ua, 'Opera')) { ...
[ "public", "static", "function", "isBuggyIe", "(", ")", "{", "if", "(", "empty", "(", "$", "_SERVER", "[", "'HTTP_USER_AGENT'", "]", ")", ")", "{", "return", "false", ";", "}", "$", "ua", "=", "$", "_SERVER", "[", "'HTTP_USER_AGENT'", "]", ";", "// quic...
Is the browser an IE version earlier than 6 SP2? @return bool
[ "Is", "the", "browser", "an", "IE", "version", "earlier", "than", "6", "SP2?" ]
258e495451c03adf57e1df81c2f0ef0c25b2f40d
https://github.com/mrclay/minify/blob/258e495451c03adf57e1df81c2f0ef0c25b2f40d/lib/HTTP/Encoder.php#L312-L329
train
mrclay/minify
lib/Minify/ScssCssSource.php
Minify_ScssCssSource.getCache
private function getCache() { // cache for single run // so that getLastModified and getContent in single request do not add additional cache roundtrips (i.e memcache) if (isset($this->parsed)) { return $this->parsed; } // check from cache first $cache = ...
php
private function getCache() { // cache for single run // so that getLastModified and getContent in single request do not add additional cache roundtrips (i.e memcache) if (isset($this->parsed)) { return $this->parsed; } // check from cache first $cache = ...
[ "private", "function", "getCache", "(", ")", "{", "// cache for single run", "// so that getLastModified and getContent in single request do not add additional cache roundtrips (i.e memcache)", "if", "(", "isset", "(", "$", "this", "->", "parsed", ")", ")", "{", "return", "$"...
Get SCSS cache object Runs the compilation if needed Implements Leafo\ScssPhp\Server logic because we need to get parsed files without parsing actual content @return array
[ "Get", "SCSS", "cache", "object" ]
258e495451c03adf57e1df81c2f0ef0c25b2f40d
https://github.com/mrclay/minify/blob/258e495451c03adf57e1df81c2f0ef0c25b2f40d/lib/Minify/ScssCssSource.php#L82-L110
train
mrclay/minify
lib/Minify/HTML/Helper.php
Minify_HTML_Helper.getUri
public static function getUri($keyOrFiles, $opts = array()) { $opts = array_merge(array( // default options 'farExpires' => true, 'debug' => false, 'charset' => 'UTF-8', 'minAppUri' => '/min', 'rewriteWorks' => true, 'groupsConfigFile' ...
php
public static function getUri($keyOrFiles, $opts = array()) { $opts = array_merge(array( // default options 'farExpires' => true, 'debug' => false, 'charset' => 'UTF-8', 'minAppUri' => '/min', 'rewriteWorks' => true, 'groupsConfigFile' ...
[ "public", "static", "function", "getUri", "(", "$", "keyOrFiles", ",", "$", "opts", "=", "array", "(", ")", ")", "{", "$", "opts", "=", "array_merge", "(", "array", "(", "// default options", "'farExpires'", "=>", "true", ",", "'debug'", "=>", "false", "...
Get an HTML-escaped Minify URI for a group or set of files @param string|array $keyOrFiles a group key or array of filepaths/URIs @param array $opts options: 'farExpires' : (default true) append a modified timestamp for cache revving 'debug' : (default false) append debug flag 'charset' : (default 'UTF-8') for htmlspe...
[ "Get", "an", "HTML", "-", "escaped", "Minify", "URI", "for", "a", "group", "or", "set", "of", "files" ]
258e495451c03adf57e1df81c2f0ef0c25b2f40d
https://github.com/mrclay/minify/blob/258e495451c03adf57e1df81c2f0ef0c25b2f40d/lib/Minify/HTML/Helper.php#L32-L56
train
mrclay/minify
lib/Minify/HTML/Helper.php
Minify_HTML_Helper.getRawUri
public function getRawUri($farExpires = true, $debug = false) { $path = rtrim($this->minAppUri, '/') . '/'; if (! $this->rewriteWorks) { $path .= '?'; } if (null === $this->_groupKey) { // @todo: implement shortest uri $path = self::_getShortestUri...
php
public function getRawUri($farExpires = true, $debug = false) { $path = rtrim($this->minAppUri, '/') . '/'; if (! $this->rewriteWorks) { $path .= '?'; } if (null === $this->_groupKey) { // @todo: implement shortest uri $path = self::_getShortestUri...
[ "public", "function", "getRawUri", "(", "$", "farExpires", "=", "true", ",", "$", "debug", "=", "false", ")", "{", "$", "path", "=", "rtrim", "(", "$", "this", "->", "minAppUri", ",", "'/'", ")", ".", "'/'", ";", "if", "(", "!", "$", "this", "->"...
Get non-HTML-escaped URI to minify the specified files @param bool $farExpires @param bool $debug @return string
[ "Get", "non", "-", "HTML", "-", "escaped", "URI", "to", "minify", "the", "specified", "files" ]
258e495451c03adf57e1df81c2f0ef0c25b2f40d
https://github.com/mrclay/minify/blob/258e495451c03adf57e1df81c2f0ef0c25b2f40d/lib/Minify/HTML/Helper.php#L65-L84
train
mrclay/minify
lib/Minify/HTML/Helper.php
Minify_HTML_Helper.setFiles
public function setFiles($files, $checkLastModified = true) { $this->_groupKey = null; if ($checkLastModified) { $this->_lastModified = self::getLastModified($files); } // normalize paths like in /min/f=<paths> foreach ($files as $k => $file) { if (0 =...
php
public function setFiles($files, $checkLastModified = true) { $this->_groupKey = null; if ($checkLastModified) { $this->_lastModified = self::getLastModified($files); } // normalize paths like in /min/f=<paths> foreach ($files as $k => $file) { if (0 =...
[ "public", "function", "setFiles", "(", "$", "files", ",", "$", "checkLastModified", "=", "true", ")", "{", "$", "this", "->", "_groupKey", "=", "null", ";", "if", "(", "$", "checkLastModified", ")", "{", "$", "this", "->", "_lastModified", "=", "self", ...
Set the files that will comprise the URI we're building @param array $files @param bool $checkLastModified
[ "Set", "the", "files", "that", "will", "comprise", "the", "URI", "we", "re", "building" ]
258e495451c03adf57e1df81c2f0ef0c25b2f40d
https://github.com/mrclay/minify/blob/258e495451c03adf57e1df81c2f0ef0c25b2f40d/lib/Minify/HTML/Helper.php#L92-L109
train
mrclay/minify
lib/Minify/HTML/Helper.php
Minify_HTML_Helper.setGroup
public function setGroup($key, $checkLastModified = true) { $this->_groupKey = $key; if ($checkLastModified) { if (! $this->groupsConfigFile) { $this->groupsConfigFile = self::app()->groupsConfigPath; } if (is_file($this->groupsConfigFile)) { ...
php
public function setGroup($key, $checkLastModified = true) { $this->_groupKey = $key; if ($checkLastModified) { if (! $this->groupsConfigFile) { $this->groupsConfigFile = self::app()->groupsConfigPath; } if (is_file($this->groupsConfigFile)) { ...
[ "public", "function", "setGroup", "(", "$", "key", ",", "$", "checkLastModified", "=", "true", ")", "{", "$", "this", "->", "_groupKey", "=", "$", "key", ";", "if", "(", "$", "checkLastModified", ")", "{", "if", "(", "!", "$", "this", "->", "groupsCo...
Set the group of files that will comprise the URI we're building @param string $key @param bool $checkLastModified
[ "Set", "the", "group", "of", "files", "that", "will", "comprise", "the", "URI", "we", "re", "building" ]
258e495451c03adf57e1df81c2f0ef0c25b2f40d
https://github.com/mrclay/minify/blob/258e495451c03adf57e1df81c2f0ef0c25b2f40d/lib/Minify/HTML/Helper.php#L117-L138
train
mrclay/minify
lib/Minify/HTML/Helper.php
Minify_HTML_Helper._getCommonCharAtPos
protected static function _getCommonCharAtPos($arr, $pos) { if (!isset($arr[0][$pos])) { return ''; } $c = $arr[0][$pos]; $l = count($arr); if ($l === 1) { return $c; } for ($i = 1; $i < $l; ++$i) { if ($arr[$i][$pos] !== $c...
php
protected static function _getCommonCharAtPos($arr, $pos) { if (!isset($arr[0][$pos])) { return ''; } $c = $arr[0][$pos]; $l = count($arr); if ($l === 1) { return $c; } for ($i = 1; $i < $l; ++$i) { if ($arr[$i][$pos] !== $c...
[ "protected", "static", "function", "_getCommonCharAtPos", "(", "$", "arr", ",", "$", "pos", ")", "{", "if", "(", "!", "isset", "(", "$", "arr", "[", "0", "]", "[", "$", "pos", "]", ")", ")", "{", "return", "''", ";", "}", "$", "c", "=", "$", ...
In a given array of strings, find the character they all have at a particular index @param array $arr array of strings @param int $pos index to check @return mixed a common char or '' if any do not match
[ "In", "a", "given", "array", "of", "strings", "find", "the", "character", "they", "all", "have", "at", "a", "particular", "index" ]
258e495451c03adf57e1df81c2f0ef0c25b2f40d
https://github.com/mrclay/minify/blob/258e495451c03adf57e1df81c2f0ef0c25b2f40d/lib/Minify/HTML/Helper.php#L193-L210
train
mrclay/minify
lib/Minify.php
Minify.getDefaultOptions
public function getDefaultOptions() { return array( 'isPublic' => true, 'encodeOutput' => function_exists('gzdeflate'), 'encodeMethod' => null, // determine later 'encodeLevel' => 9, 'minifiers' => array( Minify::TYPE_JS => array('...
php
public function getDefaultOptions() { return array( 'isPublic' => true, 'encodeOutput' => function_exists('gzdeflate'), 'encodeMethod' => null, // determine later 'encodeLevel' => 9, 'minifiers' => array( Minify::TYPE_JS => array('...
[ "public", "function", "getDefaultOptions", "(", ")", "{", "return", "array", "(", "'isPublic'", "=>", "true", ",", "'encodeOutput'", "=>", "function_exists", "(", "'gzdeflate'", ")", ",", "'encodeMethod'", "=>", "null", ",", "// determine later", "'encodeLevel'", ...
Get default Minify options. @return array options for Minify
[ "Get", "default", "Minify", "options", "." ]
258e495451c03adf57e1df81c2f0ef0c25b2f40d
https://github.com/mrclay/minify/blob/258e495451c03adf57e1df81c2f0ef0c25b2f40d/lib/Minify.php#L99-L140
train
mrclay/minify
lib/Minify.php
Minify.combine
public function combine($sources, $options = array()) { $tmpCache = $this->cache; $this->cache = new Minify_Cache_Null(); $env = new Minify_Env(); $sourceFactory = new Minify_Source_Factory($env, array( 'checkAllowDirs' => false, ), $this->cache); $contro...
php
public function combine($sources, $options = array()) { $tmpCache = $this->cache; $this->cache = new Minify_Cache_Null(); $env = new Minify_Env(); $sourceFactory = new Minify_Source_Factory($env, array( 'checkAllowDirs' => false, ), $this->cache); $contro...
[ "public", "function", "combine", "(", "$", "sources", ",", "$", "options", "=", "array", "(", ")", ")", "{", "$", "tmpCache", "=", "$", "this", "->", "cache", ";", "$", "this", "->", "cache", "=", "new", "Minify_Cache_Null", "(", ")", ";", "$", "en...
Return combined minified content for a set of sources No internal caching will be used and the content will not be HTTP encoded. @param array $sources array of filepaths and/or Minify_Source objects @param array $options (optional) array of options for serve. @return string
[ "Return", "combined", "minified", "content", "for", "a", "set", "of", "sources" ]
258e495451c03adf57e1df81c2f0ef0c25b2f40d
https://github.com/mrclay/minify/blob/258e495451c03adf57e1df81c2f0ef0c25b2f40d/lib/Minify.php#L435-L457
train
mrclay/minify
lib/Minify.php
Minify.errorExit
public function errorExit($header, $url = '', $msgHtml = '') { $url = htmlspecialchars($url, ENT_QUOTES); list(,$h1) = explode(' ', $header, 2); $h1 = htmlspecialchars($h1); // FastCGI environments require 3rd arg to header() to be set list(, $code) = explode(' ', $header, 3)...
php
public function errorExit($header, $url = '', $msgHtml = '') { $url = htmlspecialchars($url, ENT_QUOTES); list(,$h1) = explode(' ', $header, 2); $h1 = htmlspecialchars($h1); // FastCGI environments require 3rd arg to header() to be set list(, $code) = explode(' ', $header, 3)...
[ "public", "function", "errorExit", "(", "$", "header", ",", "$", "url", "=", "''", ",", "$", "msgHtml", "=", "''", ")", "{", "$", "url", "=", "htmlspecialchars", "(", "$", "url", ",", "ENT_QUOTES", ")", ";", "list", "(", ",", "$", "h1", ")", "=",...
Show an error page @param string $header Full header. E.g. 'HTTP/1.0 500 Internal Server Error' @param string $url URL to direct the user to @param string $msgHtml HTML message for the client @return void @internal This is not part of the public API and is subject to change @access private
[ "Show", "an", "error", "page" ]
258e495451c03adf57e1df81c2f0ef0c25b2f40d
https://github.com/mrclay/minify/blob/258e495451c03adf57e1df81c2f0ef0c25b2f40d/lib/Minify.php#L470-L487
train
mrclay/minify
lib/Minify.php
Minify.nullMinifier
public static function nullMinifier($content) { if (isset($content[0]) && $content[0] === "\xef") { $content = substr($content, 3); } $content = str_replace("\r\n", "\n", $content); return trim($content); }
php
public static function nullMinifier($content) { if (isset($content[0]) && $content[0] === "\xef") { $content = substr($content, 3); } $content = str_replace("\r\n", "\n", $content); return trim($content); }
[ "public", "static", "function", "nullMinifier", "(", "$", "content", ")", "{", "if", "(", "isset", "(", "$", "content", "[", "0", "]", ")", "&&", "$", "content", "[", "0", "]", "===", "\"\\xef\"", ")", "{", "$", "content", "=", "substr", "(", "$", ...
Default minifier for .min or -min JS files. @param string $content @return string
[ "Default", "minifier", "for", ".", "min", "or", "-", "min", "JS", "files", "." ]
258e495451c03adf57e1df81c2f0ef0c25b2f40d
https://github.com/mrclay/minify/blob/258e495451c03adf57e1df81c2f0ef0c25b2f40d/lib/Minify.php#L495-L503
train
mrclay/minify
lib/Minify.php
Minify.setupUriRewrites
protected function setupUriRewrites() { foreach ($this->sources as $key => $source) { $file = $this->env->normalizePath($source->getFilePath()); $minifyOptions = $source->getMinifierOptions(); if ($file && !isset($minifyOptions['currentDir']) ...
php
protected function setupUriRewrites() { foreach ($this->sources as $key => $source) { $file = $this->env->normalizePath($source->getFilePath()); $minifyOptions = $source->getMinifierOptions(); if ($file && !isset($minifyOptions['currentDir']) ...
[ "protected", "function", "setupUriRewrites", "(", ")", "{", "foreach", "(", "$", "this", "->", "sources", "as", "$", "key", "=>", "$", "source", ")", "{", "$", "file", "=", "$", "this", "->", "env", "->", "normalizePath", "(", "$", "source", "->", "g...
Setup CSS sources for URI rewriting
[ "Setup", "CSS", "sources", "for", "URI", "rewriting" ]
258e495451c03adf57e1df81c2f0ef0c25b2f40d
https://github.com/mrclay/minify/blob/258e495451c03adf57e1df81c2f0ef0c25b2f40d/lib/Minify.php#L508-L521
train
mrclay/minify
lib/Minify.php
Minify.setupDebug
protected function setupDebug() { foreach ($this->sources as $source) { $source->setMinifier(array('Minify_Lines', 'minify')); $id = $source->getId(); $source->setMinifierOptions(array( 'id' => (is_file($id) ? basename($id) : $id), )); ...
php
protected function setupDebug() { foreach ($this->sources as $source) { $source->setMinifier(array('Minify_Lines', 'minify')); $id = $source->getId(); $source->setMinifierOptions(array( 'id' => (is_file($id) ? basename($id) : $id), )); ...
[ "protected", "function", "setupDebug", "(", ")", "{", "foreach", "(", "$", "this", "->", "sources", "as", "$", "source", ")", "{", "$", "source", "->", "setMinifier", "(", "array", "(", "'Minify_Lines'", ",", "'minify'", ")", ")", ";", "$", "id", "=", ...
Set up sources to use Minify_Lines
[ "Set", "up", "sources", "to", "use", "Minify_Lines" ]
258e495451c03adf57e1df81c2f0ef0c25b2f40d
https://github.com/mrclay/minify/blob/258e495451c03adf57e1df81c2f0ef0c25b2f40d/lib/Minify.php#L526-L535
train
mrclay/minify
lib/Minify.php
Minify.combineMinify
protected function combineMinify() { $type = $this->options['contentType']; // ease readability // when combining scripts, make sure all statements separated and // trailing single line comment is terminated $implodeSeparator = ($type === self::TYPE_JS) ? "\n;" : ''; // all...
php
protected function combineMinify() { $type = $this->options['contentType']; // ease readability // when combining scripts, make sure all statements separated and // trailing single line comment is terminated $implodeSeparator = ($type === self::TYPE_JS) ? "\n;" : ''; // all...
[ "protected", "function", "combineMinify", "(", ")", "{", "$", "type", "=", "$", "this", "->", "options", "[", "'contentType'", "]", ";", "// ease readability", "// when combining scripts, make sure all statements separated and", "// trailing single line comment is terminated", ...
Combines sources and minifies the result. @return string @throws Exception
[ "Combines", "sources", "and", "minifies", "the", "result", "." ]
258e495451c03adf57e1df81c2f0ef0c25b2f40d
https://github.com/mrclay/minify/blob/258e495451c03adf57e1df81c2f0ef0c25b2f40d/lib/Minify.php#L544-L634
train
mrclay/minify
lib/Minify.php
Minify._getCacheId
protected function _getCacheId($prefix = 'minify') { $name = preg_replace('/[^a-zA-Z0-9\\.=_,]/', '', $this->selectionId); $name = preg_replace('/\\.+/', '.', $name); $name = substr($name, 0, 100 - 34 - strlen($prefix)); $md5 = md5(serialize(array( Minify_SourceSet::getDi...
php
protected function _getCacheId($prefix = 'minify') { $name = preg_replace('/[^a-zA-Z0-9\\.=_,]/', '', $this->selectionId); $name = preg_replace('/\\.+/', '.', $name); $name = substr($name, 0, 100 - 34 - strlen($prefix)); $md5 = md5(serialize(array( Minify_SourceSet::getDi...
[ "protected", "function", "_getCacheId", "(", "$", "prefix", "=", "'minify'", ")", "{", "$", "name", "=", "preg_replace", "(", "'/[^a-zA-Z0-9\\\\.=_,]/'", ",", "''", ",", "$", "this", "->", "selectionId", ")", ";", "$", "name", "=", "preg_replace", "(", "'/...
Make a unique cache id for for this request. Any settings that could affect output are taken into consideration @param string $prefix @return string
[ "Make", "a", "unique", "cache", "id", "for", "for", "this", "request", "." ]
258e495451c03adf57e1df81c2f0ef0c25b2f40d
https://github.com/mrclay/minify/blob/258e495451c03adf57e1df81c2f0ef0c25b2f40d/lib/Minify.php#L645-L660
train
mrclay/minify
lib/Minify/JS/ClosureCompiler.php
Minify_JS_ClosureCompiler.min
public function min($js) { $postBody = $this->buildPostBody($js); if ($this->maxBytes > 0) { $bytes = (function_exists('mb_strlen') && ((int)ini_get('mbstring.func_overload') & 2)) ? mb_strlen($postBody, '8bit') : strlen($postBody); if ($bytes...
php
public function min($js) { $postBody = $this->buildPostBody($js); if ($this->maxBytes > 0) { $bytes = (function_exists('mb_strlen') && ((int)ini_get('mbstring.func_overload') & 2)) ? mb_strlen($postBody, '8bit') : strlen($postBody); if ($bytes...
[ "public", "function", "min", "(", "$", "js", ")", "{", "$", "postBody", "=", "$", "this", "->", "buildPostBody", "(", "$", "js", ")", ";", "if", "(", "$", "this", "->", "maxBytes", ">", "0", ")", "{", "$", "bytes", "=", "(", "function_exists", "(...
Call the service to perform the minification @param string $js JavaScript code @return string @throws Minify_JS_ClosureCompiler_Exception
[ "Call", "the", "service", "to", "perform", "the", "minification" ]
258e495451c03adf57e1df81c2f0ef0c25b2f40d
https://github.com/mrclay/minify/blob/258e495451c03adf57e1df81c2f0ef0c25b2f40d/lib/Minify/JS/ClosureCompiler.php#L126-L160
train
mrclay/minify
lib/Minify/JS/ClosureCompiler.php
Minify_JS_ClosureCompiler.getResponse
protected function getResponse($postBody) { $allowUrlFopen = preg_match('/1|yes|on|true/i', ini_get('allow_url_fopen')); if ($allowUrlFopen) { $contents = file_get_contents($this->serviceUrl, false, stream_context_create(array( 'http' => array( 'metho...
php
protected function getResponse($postBody) { $allowUrlFopen = preg_match('/1|yes|on|true/i', ini_get('allow_url_fopen')); if ($allowUrlFopen) { $contents = file_get_contents($this->serviceUrl, false, stream_context_create(array( 'http' => array( 'metho...
[ "protected", "function", "getResponse", "(", "$", "postBody", ")", "{", "$", "allowUrlFopen", "=", "preg_match", "(", "'/1|yes|on|true/i'", ",", "ini_get", "(", "'allow_url_fopen'", ")", ")", ";", "if", "(", "$", "allowUrlFopen", ")", "{", "$", "contents", "...
Get the response for a given POST body @param string $postBody @return string @throws Minify_JS_ClosureCompiler_Exception
[ "Get", "the", "response", "for", "a", "given", "POST", "body" ]
258e495451c03adf57e1df81c2f0ef0c25b2f40d
https://github.com/mrclay/minify/blob/258e495451c03adf57e1df81c2f0ef0c25b2f40d/lib/Minify/JS/ClosureCompiler.php#L169-L209
train
mrclay/minify
lib/Minify/JS/ClosureCompiler.php
Minify_JS_ClosureCompiler.buildPostBody
protected function buildPostBody($js, $returnErrors = false) { return http_build_query( array_merge( self::$DEFAULT_OPTIONS, $this->additionalOptions, array( 'js_code' => $js, 'output_info' => ($returnErrors ...
php
protected function buildPostBody($js, $returnErrors = false) { return http_build_query( array_merge( self::$DEFAULT_OPTIONS, $this->additionalOptions, array( 'js_code' => $js, 'output_info' => ($returnErrors ...
[ "protected", "function", "buildPostBody", "(", "$", "js", ",", "$", "returnErrors", "=", "false", ")", "{", "return", "http_build_query", "(", "array_merge", "(", "self", "::", "$", "DEFAULT_OPTIONS", ",", "$", "this", "->", "additionalOptions", ",", "array", ...
Build a POST request body @param string $js JavaScript code @param bool $returnErrors @return string
[ "Build", "a", "POST", "request", "body" ]
258e495451c03adf57e1df81c2f0ef0c25b2f40d
https://github.com/mrclay/minify/blob/258e495451c03adf57e1df81c2f0ef0c25b2f40d/lib/Minify/JS/ClosureCompiler.php#L218-L232
train
laravel/dusk
src/Console/ChromeDriverCommand.php
ChromeDriverCommand.extract
protected function extract($archive) { $zip = new ZipArchive; $zip->open($archive); $zip->extractTo($this->directory); $binary = $zip->getNameIndex(0); $zip->close(); unlink($archive); return $binary; }
php
protected function extract($archive) { $zip = new ZipArchive; $zip->open($archive); $zip->extractTo($this->directory); $binary = $zip->getNameIndex(0); $zip->close(); unlink($archive); return $binary; }
[ "protected", "function", "extract", "(", "$", "archive", ")", "{", "$", "zip", "=", "new", "ZipArchive", ";", "$", "zip", "->", "open", "(", "$", "archive", ")", ";", "$", "zip", "->", "extractTo", "(", "$", "this", "->", "directory", ")", ";", "$"...
Extract the ChromeDriver binary from the archive and delete the archive. @param string $archive @return string
[ "Extract", "the", "ChromeDriver", "binary", "from", "the", "archive", "and", "delete", "the", "archive", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Console/ChromeDriverCommand.php#L197-L212
train
laravel/dusk
src/Console/ChromeDriverCommand.php
ChromeDriverCommand.rename
protected function rename($binary, $os) { $newName = str_replace('chromedriver', 'chromedriver-'.$os, $binary); rename($this->directory.$binary, $this->directory.$newName); chmod($this->directory.$newName, 0755); }
php
protected function rename($binary, $os) { $newName = str_replace('chromedriver', 'chromedriver-'.$os, $binary); rename($this->directory.$binary, $this->directory.$newName); chmod($this->directory.$newName, 0755); }
[ "protected", "function", "rename", "(", "$", "binary", ",", "$", "os", ")", "{", "$", "newName", "=", "str_replace", "(", "'chromedriver'", ",", "'chromedriver-'", ".", "$", "os", ",", "$", "binary", ")", ";", "rename", "(", "$", "this", "->", "directo...
Rename the ChromeDriver binary and make it executable. @param string $binary @param string $os @return void
[ "Rename", "the", "ChromeDriver", "binary", "and", "make", "it", "executable", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Console/ChromeDriverCommand.php#L221-L228
train
laravel/dusk
src/Concerns/WaitsForElements.php
WaitsForElements.whenAvailable
public function whenAvailable($selector, Closure $callback, $seconds = null) { return $this->waitFor($selector, $seconds)->with($selector, $callback); }
php
public function whenAvailable($selector, Closure $callback, $seconds = null) { return $this->waitFor($selector, $seconds)->with($selector, $callback); }
[ "public", "function", "whenAvailable", "(", "$", "selector", ",", "Closure", "$", "callback", ",", "$", "seconds", "=", "null", ")", "{", "return", "$", "this", "->", "waitFor", "(", "$", "selector", ",", "$", "seconds", ")", "->", "with", "(", "$", ...
Execute the given callback in a scoped browser once the selector is available. @param string $selector @param Closure $callback @param int $seconds @return $this @throws \Facebook\WebDriver\Exception\TimeOutException
[ "Execute", "the", "given", "callback", "in", "a", "scoped", "browser", "once", "the", "selector", "is", "available", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/WaitsForElements.php#L25-L28
train
laravel/dusk
src/Concerns/WaitsForElements.php
WaitsForElements.waitFor
public function waitFor($selector, $seconds = null) { $message = $this->formatTimeOutMessage('Waited %s seconds for selector', $selector); return $this->waitUsing($seconds, 100, function () use ($selector) { return $this->resolver->findOrFail($selector)->isDisplayed(); }, $messa...
php
public function waitFor($selector, $seconds = null) { $message = $this->formatTimeOutMessage('Waited %s seconds for selector', $selector); return $this->waitUsing($seconds, 100, function () use ($selector) { return $this->resolver->findOrFail($selector)->isDisplayed(); }, $messa...
[ "public", "function", "waitFor", "(", "$", "selector", ",", "$", "seconds", "=", "null", ")", "{", "$", "message", "=", "$", "this", "->", "formatTimeOutMessage", "(", "'Waited %s seconds for selector'", ",", "$", "selector", ")", ";", "return", "$", "this",...
Wait for the given selector to be visible. @param string $selector @param int $seconds @return $this @throws \Facebook\WebDriver\Exception\TimeOutException
[ "Wait", "for", "the", "given", "selector", "to", "be", "visible", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/WaitsForElements.php#L38-L45
train
laravel/dusk
src/Concerns/WaitsForElements.php
WaitsForElements.waitUntilMissing
public function waitUntilMissing($selector, $seconds = null) { $message = $this->formatTimeOutMessage('Waited %s seconds for removal of selector', $selector); return $this->waitUsing($seconds, 100, function () use ($selector) { try { $missing = ! $this->resolver->findOrF...
php
public function waitUntilMissing($selector, $seconds = null) { $message = $this->formatTimeOutMessage('Waited %s seconds for removal of selector', $selector); return $this->waitUsing($seconds, 100, function () use ($selector) { try { $missing = ! $this->resolver->findOrF...
[ "public", "function", "waitUntilMissing", "(", "$", "selector", ",", "$", "seconds", "=", "null", ")", "{", "$", "message", "=", "$", "this", "->", "formatTimeOutMessage", "(", "'Waited %s seconds for removal of selector'", ",", "$", "selector", ")", ";", "retur...
Wait for the given selector to be removed. @param string $selector @param int $seconds @return $this @throws \Facebook\WebDriver\Exception\TimeOutException
[ "Wait", "for", "the", "given", "selector", "to", "be", "removed", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/WaitsForElements.php#L55-L68
train
laravel/dusk
src/Concerns/WaitsForElements.php
WaitsForElements.waitForText
public function waitForText($text, $seconds = null) { $text = Arr::wrap($text); $message = $this->formatTimeOutMessage('Waited %s seconds for text', implode("', '", $text)); return $this->waitUsing($seconds, 100, function () use ($text) { return Str::contains($this->resolver->f...
php
public function waitForText($text, $seconds = null) { $text = Arr::wrap($text); $message = $this->formatTimeOutMessage('Waited %s seconds for text', implode("', '", $text)); return $this->waitUsing($seconds, 100, function () use ($text) { return Str::contains($this->resolver->f...
[ "public", "function", "waitForText", "(", "$", "text", ",", "$", "seconds", "=", "null", ")", "{", "$", "text", "=", "Arr", "::", "wrap", "(", "$", "text", ")", ";", "$", "message", "=", "$", "this", "->", "formatTimeOutMessage", "(", "'Waited %s secon...
Wait for the given text to be visible. @param array|string $text @param int $seconds @return $this @throws \Facebook\WebDriver\Exception\TimeOutException
[ "Wait", "for", "the", "given", "text", "to", "be", "visible", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/WaitsForElements.php#L78-L87
train
laravel/dusk
src/Concerns/WaitsForElements.php
WaitsForElements.waitForLink
public function waitForLink($link, $seconds = null) { $message = $this->formatTimeOutMessage('Waited %s seconds for link', $link); return $this->waitUsing($seconds, 100, function () use ($link) { return $this->seeLink($link); }, $message); }
php
public function waitForLink($link, $seconds = null) { $message = $this->formatTimeOutMessage('Waited %s seconds for link', $link); return $this->waitUsing($seconds, 100, function () use ($link) { return $this->seeLink($link); }, $message); }
[ "public", "function", "waitForLink", "(", "$", "link", ",", "$", "seconds", "=", "null", ")", "{", "$", "message", "=", "$", "this", "->", "formatTimeOutMessage", "(", "'Waited %s seconds for link'", ",", "$", "link", ")", ";", "return", "$", "this", "->",...
Wait for the given link to be visible. @param string $link @param int $seconds @return $this @throws \Facebook\WebDriver\Exception\TimeOutException
[ "Wait", "for", "the", "given", "link", "to", "be", "visible", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/WaitsForElements.php#L97-L104
train
laravel/dusk
src/Concerns/WaitsForElements.php
WaitsForElements.waitForLocation
public function waitForLocation($path, $seconds = null) { $message = $this->formatTimeOutMessage('Waited %s seconds for location', $path); return $this->waitUntil("window.location.pathname == '{$path}'", $seconds, $message); }
php
public function waitForLocation($path, $seconds = null) { $message = $this->formatTimeOutMessage('Waited %s seconds for location', $path); return $this->waitUntil("window.location.pathname == '{$path}'", $seconds, $message); }
[ "public", "function", "waitForLocation", "(", "$", "path", ",", "$", "seconds", "=", "null", ")", "{", "$", "message", "=", "$", "this", "->", "formatTimeOutMessage", "(", "'Waited %s seconds for location'", ",", "$", "path", ")", ";", "return", "$", "this",...
Wait for the given location. @param string $path @param int $seconds @return $this @throws \Facebook\WebDriver\Exception\TimeOutException
[ "Wait", "for", "the", "given", "location", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/WaitsForElements.php#L114-L119
train
laravel/dusk
src/Concerns/WaitsForElements.php
WaitsForElements.waitForRoute
public function waitForRoute($route, $parameters = [], $seconds = null) { return $this->waitForLocation(route($route, $parameters, false), $seconds); }
php
public function waitForRoute($route, $parameters = [], $seconds = null) { return $this->waitForLocation(route($route, $parameters, false), $seconds); }
[ "public", "function", "waitForRoute", "(", "$", "route", ",", "$", "parameters", "=", "[", "]", ",", "$", "seconds", "=", "null", ")", "{", "return", "$", "this", "->", "waitForLocation", "(", "route", "(", "$", "route", ",", "$", "parameters", ",", ...
Wait for the given location using a named route. @param string $route @param array $parameters @param int $seconds @return $this @throws \Facebook\WebDriver\Exception\TimeOutException
[ "Wait", "for", "the", "given", "location", "using", "a", "named", "route", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/WaitsForElements.php#L130-L133
train
laravel/dusk
src/Concerns/WaitsForElements.php
WaitsForElements.waitUntil
public function waitUntil($script, $seconds = null, $message = null) { if (! Str::startsWith($script, 'return ')) { $script = 'return '.$script; } if (! Str::endsWith($script, ';')) { $script = $script.';'; } return $this->waitUsing($seconds, 100, fu...
php
public function waitUntil($script, $seconds = null, $message = null) { if (! Str::startsWith($script, 'return ')) { $script = 'return '.$script; } if (! Str::endsWith($script, ';')) { $script = $script.';'; } return $this->waitUsing($seconds, 100, fu...
[ "public", "function", "waitUntil", "(", "$", "script", ",", "$", "seconds", "=", "null", ",", "$", "message", "=", "null", ")", "{", "if", "(", "!", "Str", "::", "startsWith", "(", "$", "script", ",", "'return '", ")", ")", "{", "$", "script", "=",...
Wait until the given script returns true. @param string $script @param int $seconds @param string $message @return $this @throws \Facebook\WebDriver\Exception\TimeOutException
[ "Wait", "until", "the", "given", "script", "returns", "true", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/WaitsForElements.php#L144-L157
train
laravel/dusk
src/Concerns/WaitsForElements.php
WaitsForElements.waitUntilVue
public function waitUntilVue($key, $value, $componentSelector = null, $seconds = null) { $this->waitUsing($seconds, 100, function () use ($key, $value, $componentSelector) { return $value == $this->vueAttribute($componentSelector, $key); }); return $this; }
php
public function waitUntilVue($key, $value, $componentSelector = null, $seconds = null) { $this->waitUsing($seconds, 100, function () use ($key, $value, $componentSelector) { return $value == $this->vueAttribute($componentSelector, $key); }); return $this; }
[ "public", "function", "waitUntilVue", "(", "$", "key", ",", "$", "value", ",", "$", "componentSelector", "=", "null", ",", "$", "seconds", "=", "null", ")", "{", "$", "this", "->", "waitUsing", "(", "$", "seconds", ",", "100", ",", "function", "(", "...
Wait until the Vue component's attribute at the given key has the given value. @param string $key @param string $value @param string|null $componentSelector @return $this
[ "Wait", "until", "the", "Vue", "component", "s", "attribute", "at", "the", "given", "key", "has", "the", "given", "value", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/WaitsForElements.php#L167-L174
train
laravel/dusk
src/Concerns/WaitsForElements.php
WaitsForElements.waitForDialog
public function waitForDialog($seconds = null) { $seconds = is_null($seconds) ? static::$waitSeconds : $seconds; $this->driver->wait($seconds, 100)->until( WebDriverExpectedCondition::alertIsPresent(), "Waited {$seconds} seconds for dialog." ); return $this; }
php
public function waitForDialog($seconds = null) { $seconds = is_null($seconds) ? static::$waitSeconds : $seconds; $this->driver->wait($seconds, 100)->until( WebDriverExpectedCondition::alertIsPresent(), "Waited {$seconds} seconds for dialog." ); return $this; }
[ "public", "function", "waitForDialog", "(", "$", "seconds", "=", "null", ")", "{", "$", "seconds", "=", "is_null", "(", "$", "seconds", ")", "?", "static", "::", "$", "waitSeconds", ":", "$", "seconds", ";", "$", "this", "->", "driver", "->", "wait", ...
Wait for a JavaScript dialog to open. @param int $seconds @return $this
[ "Wait", "for", "a", "JavaScript", "dialog", "to", "open", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/WaitsForElements.php#L199-L208
train
laravel/dusk
src/Concerns/WaitsForElements.php
WaitsForElements.waitForReload
public function waitForReload($callback = null, $seconds = null) { $token = Str::random(); $this->driver->executeScript("window['{$token}'] = {};"); if ($callback) { $callback($this); } return $this->waitUsing($seconds, 100, function () use ($token) { ...
php
public function waitForReload($callback = null, $seconds = null) { $token = Str::random(); $this->driver->executeScript("window['{$token}'] = {};"); if ($callback) { $callback($this); } return $this->waitUsing($seconds, 100, function () use ($token) { ...
[ "public", "function", "waitForReload", "(", "$", "callback", "=", "null", ",", "$", "seconds", "=", "null", ")", "{", "$", "token", "=", "Str", "::", "random", "(", ")", ";", "$", "this", "->", "driver", "->", "executeScript", "(", "\"window['{$token}'] ...
Wait for the current page to reload. @param Closure $callback @param int $seconds @return $this @throws \Facebook\WebDriver\Exception\TimeOutException
[ "Wait", "for", "the", "current", "page", "to", "reload", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/WaitsForElements.php#L218-L231
train
laravel/dusk
src/Concerns/WaitsForElements.php
WaitsForElements.waitUsing
public function waitUsing($seconds, $interval, Closure $callback, $message = null) { $seconds = is_null($seconds) ? static::$waitSeconds : $seconds; $this->pause($interval); $started = Carbon::now(); while (true) { try { if ($callback()) { ...
php
public function waitUsing($seconds, $interval, Closure $callback, $message = null) { $seconds = is_null($seconds) ? static::$waitSeconds : $seconds; $this->pause($interval); $started = Carbon::now(); while (true) { try { if ($callback()) { ...
[ "public", "function", "waitUsing", "(", "$", "seconds", ",", "$", "interval", ",", "Closure", "$", "callback", ",", "$", "message", "=", "null", ")", "{", "$", "seconds", "=", "is_null", "(", "$", "seconds", ")", "?", "static", "::", "$", "waitSeconds"...
Wait for the given callback to be true. @param int $seconds @param int $interval @param Closure $callback @param string|null $message @return $this @throws \Facebook\WebDriver\Exception\TimeOutException
[ "Wait", "for", "the", "given", "callback", "to", "be", "true", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/WaitsForElements.php#L243-L271
train
laravel/dusk
src/Concerns/InteractsWithAuthentication.php
InteractsWithAuthentication.loginAs
public function loginAs($userId, $guard = null) { $userId = method_exists($userId, 'getKey') ? $userId->getKey() : $userId; return $this->visit(rtrim('/_dusk/login/'.$userId.'/'.$guard, '/')); }
php
public function loginAs($userId, $guard = null) { $userId = method_exists($userId, 'getKey') ? $userId->getKey() : $userId; return $this->visit(rtrim('/_dusk/login/'.$userId.'/'.$guard, '/')); }
[ "public", "function", "loginAs", "(", "$", "userId", ",", "$", "guard", "=", "null", ")", "{", "$", "userId", "=", "method_exists", "(", "$", "userId", ",", "'getKey'", ")", "?", "$", "userId", "->", "getKey", "(", ")", ":", "$", "userId", ";", "re...
Log into the application using a given user ID or email. @param object|string $userId @param string $guard @return $this
[ "Log", "into", "the", "application", "using", "a", "given", "user", "ID", "or", "email", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/InteractsWithAuthentication.php#L27-L32
train
laravel/dusk
src/Dusk.php
Dusk.duskEnvironment
protected static function duskEnvironment($options) { if (! isset($options['environments'])) { return false; } if (is_string($options['environments'])) { $options['environments'] = [$options['environments']]; } if (! is_array($options['environments']...
php
protected static function duskEnvironment($options) { if (! isset($options['environments'])) { return false; } if (is_string($options['environments'])) { $options['environments'] = [$options['environments']]; } if (! is_array($options['environments']...
[ "protected", "static", "function", "duskEnvironment", "(", "$", "options", ")", "{", "if", "(", "!", "isset", "(", "$", "options", "[", "'environments'", "]", ")", ")", "{", "return", "false", ";", "}", "if", "(", "is_string", "(", "$", "options", "[",...
Determine if Dusk may run in this environment. @param array $options @return bool
[ "Determine", "if", "Dusk", "may", "run", "in", "this", "environment", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Dusk.php#L28-L43
train
laravel/dusk
src/Concerns/InteractsWithMouse.php
InteractsWithMouse.moveMouse
public function moveMouse($xOffset, $yOffset) { (new WebDriverActions($this->driver))->moveByOffset( $xOffset, $yOffset )->perform(); return $this; }
php
public function moveMouse($xOffset, $yOffset) { (new WebDriverActions($this->driver))->moveByOffset( $xOffset, $yOffset )->perform(); return $this; }
[ "public", "function", "moveMouse", "(", "$", "xOffset", ",", "$", "yOffset", ")", "{", "(", "new", "WebDriverActions", "(", "$", "this", "->", "driver", ")", ")", "->", "moveByOffset", "(", "$", "xOffset", ",", "$", "yOffset", ")", "->", "perform", "("...
Move the mouse by offset X and Y. @param int $xOffset @param int $yOffset @return $this
[ "Move", "the", "mouse", "by", "offset", "X", "and", "Y", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/InteractsWithMouse.php#L16-L23
train
laravel/dusk
src/Concerns/InteractsWithMouse.php
InteractsWithMouse.mouseover
public function mouseover($selector) { $element = $this->resolver->findOrFail($selector); $this->driver->getMouse()->mouseMove($element->getCoordinates()); return $this; }
php
public function mouseover($selector) { $element = $this->resolver->findOrFail($selector); $this->driver->getMouse()->mouseMove($element->getCoordinates()); return $this; }
[ "public", "function", "mouseover", "(", "$", "selector", ")", "{", "$", "element", "=", "$", "this", "->", "resolver", "->", "findOrFail", "(", "$", "selector", ")", ";", "$", "this", "->", "driver", "->", "getMouse", "(", ")", "->", "mouseMove", "(", ...
Move the mouse over the given selector. @param string $selector @return $this
[ "Move", "the", "mouse", "over", "the", "given", "selector", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/InteractsWithMouse.php#L31-L38
train
laravel/dusk
src/Concerns/InteractsWithMouse.php
InteractsWithMouse.click
public function click($selector = null) { if (is_null($selector)) { (new WebDriverActions($this->driver))->click()->perform(); } else { $this->resolver->findOrFail($selector)->click(); } return $this; }
php
public function click($selector = null) { if (is_null($selector)) { (new WebDriverActions($this->driver))->click()->perform(); } else { $this->resolver->findOrFail($selector)->click(); } return $this; }
[ "public", "function", "click", "(", "$", "selector", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "selector", ")", ")", "{", "(", "new", "WebDriverActions", "(", "$", "this", "->", "driver", ")", ")", "->", "click", "(", ")", "->", "perfo...
Click the element at the given selector. @param string|null $selector @return $this
[ "Click", "the", "element", "at", "the", "given", "selector", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/InteractsWithMouse.php#L46-L55
train
laravel/dusk
src/Concerns/InteractsWithMouse.php
InteractsWithMouse.rightClick
public function rightClick($selector = null) { if (is_null($selector)) { (new WebDriverActions($this->driver))->contextClick()->perform(); } else { (new WebDriverActions($this->driver))->contextClick( $this->resolver->findOrFail($selector) )->perfo...
php
public function rightClick($selector = null) { if (is_null($selector)) { (new WebDriverActions($this->driver))->contextClick()->perform(); } else { (new WebDriverActions($this->driver))->contextClick( $this->resolver->findOrFail($selector) )->perfo...
[ "public", "function", "rightClick", "(", "$", "selector", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "selector", ")", ")", "{", "(", "new", "WebDriverActions", "(", "$", "this", "->", "driver", ")", ")", "->", "contextClick", "(", ")", "-...
Right click the element at the given selector. @param string|null $selector @return $this
[ "Right", "click", "the", "element", "at", "the", "given", "selector", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/InteractsWithMouse.php#L87-L98
train
laravel/dusk
src/Concerns/ProvidesBrowser.php
ProvidesBrowser.browse
public function browse(Closure $callback) { $browsers = $this->createBrowsersFor($callback); try { $callback(...$browsers->all()); } catch (Exception $e) { $this->captureFailuresFor($browsers); throw $e; } catch (Throwable $e) { $this...
php
public function browse(Closure $callback) { $browsers = $this->createBrowsersFor($callback); try { $callback(...$browsers->all()); } catch (Exception $e) { $this->captureFailuresFor($browsers); throw $e; } catch (Throwable $e) { $this...
[ "public", "function", "browse", "(", "Closure", "$", "callback", ")", "{", "$", "browsers", "=", "$", "this", "->", "createBrowsersFor", "(", "$", "callback", ")", ";", "try", "{", "$", "callback", "(", "...", "$", "browsers", "->", "all", "(", ")", ...
Create a new browser instance. @param \Closure $callback @return \Laravel\Dusk\Browser|void @throws \Exception @throws \Throwable
[ "Create", "a", "new", "browser", "instance", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/ProvidesBrowser.php#L62-L81
train
laravel/dusk
src/Concerns/ProvidesBrowser.php
ProvidesBrowser.createBrowsersFor
protected function createBrowsersFor(Closure $callback) { if (count(static::$browsers) === 0) { static::$browsers = collect([$this->newBrowser($this->createWebDriver())]); } $additional = $this->browsersNeededFor($callback) - 1; for ($i = 0; $i < $additional; $i++) { ...
php
protected function createBrowsersFor(Closure $callback) { if (count(static::$browsers) === 0) { static::$browsers = collect([$this->newBrowser($this->createWebDriver())]); } $additional = $this->browsersNeededFor($callback) - 1; for ($i = 0; $i < $additional; $i++) { ...
[ "protected", "function", "createBrowsersFor", "(", "Closure", "$", "callback", ")", "{", "if", "(", "count", "(", "static", "::", "$", "browsers", ")", "===", "0", ")", "{", "static", "::", "$", "browsers", "=", "collect", "(", "[", "$", "this", "->", ...
Create the browser instances needed for the given callback. @param \Closure $callback @return array @throws \ReflectionException
[ "Create", "the", "browser", "instances", "needed", "for", "the", "given", "callback", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/ProvidesBrowser.php#L90-L103
train
laravel/dusk
src/Concerns/ProvidesBrowser.php
ProvidesBrowser.captureFailuresFor
protected function captureFailuresFor($browsers) { $browsers->each(function ($browser, $key) { $name = str_replace('\\', '_', get_class($this)).'_'.$this->getName(false); $browser->screenshot('failure-'.$name.'-'.$key); }); }
php
protected function captureFailuresFor($browsers) { $browsers->each(function ($browser, $key) { $name = str_replace('\\', '_', get_class($this)).'_'.$this->getName(false); $browser->screenshot('failure-'.$name.'-'.$key); }); }
[ "protected", "function", "captureFailuresFor", "(", "$", "browsers", ")", "{", "$", "browsers", "->", "each", "(", "function", "(", "$", "browser", ",", "$", "key", ")", "{", "$", "name", "=", "str_replace", "(", "'\\\\'", ",", "'_'", ",", "get_class", ...
Capture failure screenshots for each browser. @param \Illuminate\Support\Collection $browsers @return void
[ "Capture", "failure", "screenshots", "for", "each", "browser", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/ProvidesBrowser.php#L134-L141
train
laravel/dusk
src/Concerns/ProvidesBrowser.php
ProvidesBrowser.storeConsoleLogsFor
protected function storeConsoleLogsFor($browsers) { $browsers->each(function ($browser, $key) { $name = str_replace('\\', '_', get_class($this)).'_'.$this->getName(false); $browser->storeConsoleLog($name.'-'.$key); }); }
php
protected function storeConsoleLogsFor($browsers) { $browsers->each(function ($browser, $key) { $name = str_replace('\\', '_', get_class($this)).'_'.$this->getName(false); $browser->storeConsoleLog($name.'-'.$key); }); }
[ "protected", "function", "storeConsoleLogsFor", "(", "$", "browsers", ")", "{", "$", "browsers", "->", "each", "(", "function", "(", "$", "browser", ",", "$", "key", ")", "{", "$", "name", "=", "str_replace", "(", "'\\\\'", ",", "'_'", ",", "get_class", ...
Store the console output for the given browsers. @param \Illuminate\Support\Collection $browsers @return void
[ "Store", "the", "console", "output", "for", "the", "given", "browsers", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/ProvidesBrowser.php#L149-L156
train
laravel/dusk
src/Chrome/ChromeProcess.php
ChromeProcess.toProcess
public function toProcess(array $arguments = []) { if ($this->driver) { return $this->process($arguments); } if ($this->onWindows()) { $this->driver = realpath(__DIR__.'/../../bin/chromedriver-win.exe'); } elseif ($this->onMac()) { $this->driver =...
php
public function toProcess(array $arguments = []) { if ($this->driver) { return $this->process($arguments); } if ($this->onWindows()) { $this->driver = realpath(__DIR__.'/../../bin/chromedriver-win.exe'); } elseif ($this->onMac()) { $this->driver =...
[ "public", "function", "toProcess", "(", "array", "$", "arguments", "=", "[", "]", ")", "{", "if", "(", "$", "this", "->", "driver", ")", "{", "return", "$", "this", "->", "process", "(", "$", "arguments", ")", ";", "}", "if", "(", "$", "this", "-...
Build the process to run Chromedriver. @param array $arguments @return \Symfony\Component\Process\Process
[ "Build", "the", "process", "to", "run", "Chromedriver", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Chrome/ChromeProcess.php#L39-L54
train
laravel/dusk
src/Chrome/ChromeProcess.php
ChromeProcess.process
protected function process(array $arguments = []) { return new Process( array_merge([realpath($this->driver)], $arguments), null, $this->chromeEnvironment() ); }
php
protected function process(array $arguments = []) { return new Process( array_merge([realpath($this->driver)], $arguments), null, $this->chromeEnvironment() ); }
[ "protected", "function", "process", "(", "array", "$", "arguments", "=", "[", "]", ")", "{", "return", "new", "Process", "(", "array_merge", "(", "[", "realpath", "(", "$", "this", "->", "driver", ")", "]", ",", "$", "arguments", ")", ",", "null", ",...
Build the Chromedriver with Symfony Process. @param array $arguments @return \Symfony\Component\Process\Process
[ "Build", "the", "Chromedriver", "with", "Symfony", "Process", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Chrome/ChromeProcess.php#L62-L67
train
laravel/dusk
src/Console/DuskCommand.php
DuskCommand.phpunitArguments
protected function phpunitArguments($options) { $options = array_values(array_filter($options, function ($option) { return ! Str::startsWith($option, '--env='); })); if (! file_exists($file = base_path('phpunit.dusk.xml'))) { $file = base_path('phpunit.dusk.xml.dist'...
php
protected function phpunitArguments($options) { $options = array_values(array_filter($options, function ($option) { return ! Str::startsWith($option, '--env='); })); if (! file_exists($file = base_path('phpunit.dusk.xml'))) { $file = base_path('phpunit.dusk.xml.dist'...
[ "protected", "function", "phpunitArguments", "(", "$", "options", ")", "{", "$", "options", "=", "array_values", "(", "array_filter", "(", "$", "options", ",", "function", "(", "$", "option", ")", "{", "return", "!", "Str", "::", "startsWith", "(", "$", ...
Get the array of arguments for running PHPUnit. @param array $options @return array
[ "Get", "the", "array", "of", "arguments", "for", "running", "PHPUnit", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Console/DuskCommand.php#L97-L108
train
laravel/dusk
src/Console/DuskCommand.php
DuskCommand.purgeScreenshots
protected function purgeScreenshots() { $path = base_path('tests/Browser/screenshots'); if (! is_dir($path)) { return; } $files = Finder::create()->files() ->in($path) ->name('failure-*'); foreach ($files as $file...
php
protected function purgeScreenshots() { $path = base_path('tests/Browser/screenshots'); if (! is_dir($path)) { return; } $files = Finder::create()->files() ->in($path) ->name('failure-*'); foreach ($files as $file...
[ "protected", "function", "purgeScreenshots", "(", ")", "{", "$", "path", "=", "base_path", "(", "'tests/Browser/screenshots'", ")", ";", "if", "(", "!", "is_dir", "(", "$", "path", ")", ")", "{", "return", ";", "}", "$", "files", "=", "Finder", "::", "...
Purge the failure screenshots. @return void
[ "Purge", "the", "failure", "screenshots", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Console/DuskCommand.php#L115-L130
train
laravel/dusk
src/Console/DuskCommand.php
DuskCommand.withDuskEnvironment
protected function withDuskEnvironment($callback) { if (file_exists(base_path($this->duskFile()))) { if (file_get_contents(base_path('.env')) !== file_get_contents(base_path($this->duskFile()))) { $this->backupEnvironment(); } $this->refreshEnvironment();...
php
protected function withDuskEnvironment($callback) { if (file_exists(base_path($this->duskFile()))) { if (file_get_contents(base_path('.env')) !== file_get_contents(base_path($this->duskFile()))) { $this->backupEnvironment(); } $this->refreshEnvironment();...
[ "protected", "function", "withDuskEnvironment", "(", "$", "callback", ")", "{", "if", "(", "file_exists", "(", "base_path", "(", "$", "this", "->", "duskFile", "(", ")", ")", ")", ")", "{", "if", "(", "file_get_contents", "(", "base_path", "(", "'.env'", ...
Run the given callback with the Dusk configuration files. @param \Closure $callback @return mixed
[ "Run", "the", "given", "callback", "with", "the", "Dusk", "configuration", "files", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Console/DuskCommand.php#L160-L179
train
laravel/dusk
src/Console/DuskCommand.php
DuskCommand.refreshEnvironment
protected function refreshEnvironment() { // BC fix to support Dotenv ^2.2 if (! method_exists(Dotenv::class, 'create')) { (new Dotenv(base_path()))->overload(); return; } Dotenv::create(base_path())->overload(); }
php
protected function refreshEnvironment() { // BC fix to support Dotenv ^2.2 if (! method_exists(Dotenv::class, 'create')) { (new Dotenv(base_path()))->overload(); return; } Dotenv::create(base_path())->overload(); }
[ "protected", "function", "refreshEnvironment", "(", ")", "{", "// BC fix to support Dotenv ^2.2", "if", "(", "!", "method_exists", "(", "Dotenv", "::", "class", ",", "'create'", ")", ")", "{", "(", "new", "Dotenv", "(", "base_path", "(", ")", ")", ")", "->",...
Refresh the current environment variables. @return void
[ "Refresh", "the", "current", "environment", "variables", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Console/DuskCommand.php#L210-L220
train
laravel/dusk
src/Console/DuskCommand.php
DuskCommand.writeConfiguration
protected function writeConfiguration() { if (! file_exists($file = base_path('phpunit.dusk.xml')) && ! file_exists(base_path('phpunit.dusk.xml.dist'))) { copy(realpath(__DIR__.'/../../stubs/phpunit.xml'), $file); return; } $this->hasPhpUnitConfiguration...
php
protected function writeConfiguration() { if (! file_exists($file = base_path('phpunit.dusk.xml')) && ! file_exists(base_path('phpunit.dusk.xml.dist'))) { copy(realpath(__DIR__.'/../../stubs/phpunit.xml'), $file); return; } $this->hasPhpUnitConfiguration...
[ "protected", "function", "writeConfiguration", "(", ")", "{", "if", "(", "!", "file_exists", "(", "$", "file", "=", "base_path", "(", "'phpunit.dusk.xml'", ")", ")", "&&", "!", "file_exists", "(", "base_path", "(", "'phpunit.dusk.xml.dist'", ")", ")", ")", "...
Write the Dusk PHPUnit configuration. @return void
[ "Write", "the", "Dusk", "PHPUnit", "configuration", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Console/DuskCommand.php#L227-L237
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertTitleContains
public function assertTitleContains($title) { PHPUnit::assertTrue( Str::contains($this->driver->getTitle(), $title), "Did not see expected value [{$title}] within title [{$this->driver->getTitle()}]." ); return $this; }
php
public function assertTitleContains($title) { PHPUnit::assertTrue( Str::contains($this->driver->getTitle(), $title), "Did not see expected value [{$title}] within title [{$this->driver->getTitle()}]." ); return $this; }
[ "public", "function", "assertTitleContains", "(", "$", "title", ")", "{", "PHPUnit", "::", "assertTrue", "(", "Str", "::", "contains", "(", "$", "this", "->", "driver", "->", "getTitle", "(", ")", ",", "$", "title", ")", ",", "\"Did not see expected value [{...
Assert that the page title contains the given value. @param string $title @return $this
[ "Assert", "that", "the", "page", "title", "contains", "the", "given", "value", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L34-L42
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertHasCookie
public function assertHasCookie($name, $decrypt = true) { $cookie = $decrypt ? $this->cookie($name) : $this->plainCookie($name); PHPUnit::assertTrue( ! is_null($cookie), "Did not find expected cookie [{$name}]." ); return $this; }
php
public function assertHasCookie($name, $decrypt = true) { $cookie = $decrypt ? $this->cookie($name) : $this->plainCookie($name); PHPUnit::assertTrue( ! is_null($cookie), "Did not find expected cookie [{$name}]." ); return $this; }
[ "public", "function", "assertHasCookie", "(", "$", "name", ",", "$", "decrypt", "=", "true", ")", "{", "$", "cookie", "=", "$", "decrypt", "?", "$", "this", "->", "cookie", "(", "$", "name", ")", ":", "$", "this", "->", "plainCookie", "(", "$", "na...
Assert that the given cookie is present. @param string $name @param bool $decrypt @return $this
[ "Assert", "that", "the", "given", "cookie", "is", "present", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L51-L61
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertCookieValue
public function assertCookieValue($name, $value, $decrypt = true) { $actual = $decrypt ? $this->cookie($name) : $this->plainCookie($name); PHPUnit::assertEquals( $value, $actual, "Cookie [{$name}] had value [{$actual}], but expected [{$value}]." ); return $t...
php
public function assertCookieValue($name, $value, $decrypt = true) { $actual = $decrypt ? $this->cookie($name) : $this->plainCookie($name); PHPUnit::assertEquals( $value, $actual, "Cookie [{$name}] had value [{$actual}], but expected [{$value}]." ); return $t...
[ "public", "function", "assertCookieValue", "(", "$", "name", ",", "$", "value", ",", "$", "decrypt", "=", "true", ")", "{", "$", "actual", "=", "$", "decrypt", "?", "$", "this", "->", "cookie", "(", "$", "name", ")", ":", "$", "this", "->", "plainC...
Assert that an encrypted cookie has a given value. @param string $name @param string $value @param bool $decrypt @return $this
[ "Assert", "that", "an", "encrypted", "cookie", "has", "a", "given", "value", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L112-L122
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertSeeIn
public function assertSeeIn($selector, $text) { $fullSelector = $this->resolver->format($selector); $element = $this->resolver->findOrFail($selector); PHPUnit::assertTrue( Str::contains($element->getText(), $text), "Did not see expected text [{$text}] within element...
php
public function assertSeeIn($selector, $text) { $fullSelector = $this->resolver->format($selector); $element = $this->resolver->findOrFail($selector); PHPUnit::assertTrue( Str::contains($element->getText(), $text), "Did not see expected text [{$text}] within element...
[ "public", "function", "assertSeeIn", "(", "$", "selector", ",", "$", "text", ")", "{", "$", "fullSelector", "=", "$", "this", "->", "resolver", "->", "format", "(", "$", "selector", ")", ";", "$", "element", "=", "$", "this", "->", "resolver", "->", ...
Assert that the given text appears within the given selector. @param string $selector @param string $text @return $this
[ "Assert", "that", "the", "given", "text", "appears", "within", "the", "given", "selector", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L165-L177
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertDontSeeIn
public function assertDontSeeIn($selector, $text) { $fullSelector = $this->resolver->format($selector); $element = $this->resolver->findOrFail($selector); PHPUnit::assertFalse( Str::contains($element->getText(), $text), "Saw unexpected text [{$text}] within element ...
php
public function assertDontSeeIn($selector, $text) { $fullSelector = $this->resolver->format($selector); $element = $this->resolver->findOrFail($selector); PHPUnit::assertFalse( Str::contains($element->getText(), $text), "Saw unexpected text [{$text}] within element ...
[ "public", "function", "assertDontSeeIn", "(", "$", "selector", ",", "$", "text", ")", "{", "$", "fullSelector", "=", "$", "this", "->", "resolver", "->", "format", "(", "$", "selector", ")", ";", "$", "element", "=", "$", "this", "->", "resolver", "->"...
Assert that the given text does not appear within the given selector. @param string $selector @param string $text @return $this
[ "Assert", "that", "the", "given", "text", "does", "not", "appear", "within", "the", "given", "selector", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L186-L198
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertSourceHas
public function assertSourceHas($code) { PHPUnit::assertTrue( Str::contains($this->driver->getPageSource(), $code), "Did not find expected source code [{$code}]" ); return $this; }
php
public function assertSourceHas($code) { PHPUnit::assertTrue( Str::contains($this->driver->getPageSource(), $code), "Did not find expected source code [{$code}]" ); return $this; }
[ "public", "function", "assertSourceHas", "(", "$", "code", ")", "{", "PHPUnit", "::", "assertTrue", "(", "Str", "::", "contains", "(", "$", "this", "->", "driver", "->", "getPageSource", "(", ")", ",", "$", "code", ")", ",", "\"Did not find expected source c...
Assert that the given source code is present on the page. @param string $code @return $this
[ "Assert", "that", "the", "given", "source", "code", "is", "present", "on", "the", "page", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L206-L214
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertSourceMissing
public function assertSourceMissing($code) { PHPUnit::assertFalse( Str::contains($this->driver->getPageSource(), $code), "Found unexpected source code [{$code}]" ); return $this; }
php
public function assertSourceMissing($code) { PHPUnit::assertFalse( Str::contains($this->driver->getPageSource(), $code), "Found unexpected source code [{$code}]" ); return $this; }
[ "public", "function", "assertSourceMissing", "(", "$", "code", ")", "{", "PHPUnit", "::", "assertFalse", "(", "Str", "::", "contains", "(", "$", "this", "->", "driver", "->", "getPageSource", "(", ")", ",", "$", "code", ")", ",", "\"Found unexpected source c...
Assert that the given source code is not present on the page. @param string $code @return $this
[ "Assert", "that", "the", "given", "source", "code", "is", "not", "present", "on", "the", "page", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L222-L230
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertSeeLink
public function assertSeeLink($link) { if ($this->resolver->prefix) { $message = "Did not see expected link [{$link}] within [{$this->resolver->prefix}]."; } else { $message = "Did not see expected link [{$link}]."; } PHPUnit::assertTrue( $this->s...
php
public function assertSeeLink($link) { if ($this->resolver->prefix) { $message = "Did not see expected link [{$link}] within [{$this->resolver->prefix}]."; } else { $message = "Did not see expected link [{$link}]."; } PHPUnit::assertTrue( $this->s...
[ "public", "function", "assertSeeLink", "(", "$", "link", ")", "{", "if", "(", "$", "this", "->", "resolver", "->", "prefix", ")", "{", "$", "message", "=", "\"Did not see expected link [{$link}] within [{$this->resolver->prefix}].\"", ";", "}", "else", "{", "$", ...
Assert that the given link is visible. @param string $link @return $this
[ "Assert", "that", "the", "given", "link", "is", "visible", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L238-L252
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertDontSeeLink
public function assertDontSeeLink($link) { if ($this->resolver->prefix) { $message = "Saw unexpected link [{$link}] within [{$this->resolver->prefix}]."; } else { $message = "Saw unexpected link [{$link}]."; } PHPUnit::assertFalse( $this->seeLink(...
php
public function assertDontSeeLink($link) { if ($this->resolver->prefix) { $message = "Saw unexpected link [{$link}] within [{$this->resolver->prefix}]."; } else { $message = "Saw unexpected link [{$link}]."; } PHPUnit::assertFalse( $this->seeLink(...
[ "public", "function", "assertDontSeeLink", "(", "$", "link", ")", "{", "if", "(", "$", "this", "->", "resolver", "->", "prefix", ")", "{", "$", "message", "=", "\"Saw unexpected link [{$link}] within [{$this->resolver->prefix}].\"", ";", "}", "else", "{", "$", "...
Assert that the given link is not visible. @param string $link @return $this
[ "Assert", "that", "the", "given", "link", "is", "not", "visible", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L260-L274
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.seeLink
public function seeLink($link) { $this->ensurejQueryIsAvailable(); $selector = addslashes(trim($this->resolver->format("a:contains('{$link}')"))); $script = <<<JS var link = jQuery.find("{$selector}"); return link.length > 0 && jQuery(link).is(':visible'); JS; ...
php
public function seeLink($link) { $this->ensurejQueryIsAvailable(); $selector = addslashes(trim($this->resolver->format("a:contains('{$link}')"))); $script = <<<JS var link = jQuery.find("{$selector}"); return link.length > 0 && jQuery(link).is(':visible'); JS; ...
[ "public", "function", "seeLink", "(", "$", "link", ")", "{", "$", "this", "->", "ensurejQueryIsAvailable", "(", ")", ";", "$", "selector", "=", "addslashes", "(", "trim", "(", "$", "this", "->", "resolver", "->", "format", "(", "\"a:contains('{$link}')\"", ...
Determine if the given link is visible. @param string $link @return bool
[ "Determine", "if", "the", "given", "link", "is", "visible", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L282-L294
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertInputValue
public function assertInputValue($field, $value) { PHPUnit::assertEquals( $value, $this->inputValue($field), "Expected value [{$value}] for the [{$field}] input does not equal the actual value [{$this->inputValue($field)}]." ); return $this; }
php
public function assertInputValue($field, $value) { PHPUnit::assertEquals( $value, $this->inputValue($field), "Expected value [{$value}] for the [{$field}] input does not equal the actual value [{$this->inputValue($field)}]." ); return $this; }
[ "public", "function", "assertInputValue", "(", "$", "field", ",", "$", "value", ")", "{", "PHPUnit", "::", "assertEquals", "(", "$", "value", ",", "$", "this", "->", "inputValue", "(", "$", "field", ")", ",", "\"Expected value [{$value}] for the [{$field}] input...
Assert that the given input or text area contains the given value. @param string $field @param string $value @return $this
[ "Assert", "that", "the", "given", "input", "or", "text", "area", "contains", "the", "given", "value", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L303-L311
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertInputValueIsNot
public function assertInputValueIsNot($field, $value) { PHPUnit::assertNotEquals( $value, $this->inputValue($field), "Value [{$value}] for the [{$field}] input should not equal the actual value." ); return $this; }
php
public function assertInputValueIsNot($field, $value) { PHPUnit::assertNotEquals( $value, $this->inputValue($field), "Value [{$value}] for the [{$field}] input should not equal the actual value." ); return $this; }
[ "public", "function", "assertInputValueIsNot", "(", "$", "field", ",", "$", "value", ")", "{", "PHPUnit", "::", "assertNotEquals", "(", "$", "value", ",", "$", "this", "->", "inputValue", "(", "$", "field", ")", ",", "\"Value [{$value}] for the [{$field}] input ...
Assert that the given input or text area does not contain the given value. @param string $field @param string $value @return $this
[ "Assert", "that", "the", "given", "input", "or", "text", "area", "does", "not", "contain", "the", "given", "value", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L320-L328
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.inputValue
public function inputValue($field) { $element = $this->resolver->resolveForTyping($field); return in_array($element->getTagName(), ['input', 'textarea']) ? $element->getAttribute('value') : $element->getText(); }
php
public function inputValue($field) { $element = $this->resolver->resolveForTyping($field); return in_array($element->getTagName(), ['input', 'textarea']) ? $element->getAttribute('value') : $element->getText(); }
[ "public", "function", "inputValue", "(", "$", "field", ")", "{", "$", "element", "=", "$", "this", "->", "resolver", "->", "resolveForTyping", "(", "$", "field", ")", ";", "return", "in_array", "(", "$", "element", "->", "getTagName", "(", ")", ",", "[...
Get the value of the given input or text area field. @param string $field @return string
[ "Get", "the", "value", "of", "the", "given", "input", "or", "text", "area", "field", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L336-L343
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertChecked
public function assertChecked($field, $value = null) { $element = $this->resolver->resolveForChecking($field, $value); PHPUnit::assertTrue( $element->isSelected(), "Expected checkbox [{$field}] to be checked, but it wasn't." ); return $this; }
php
public function assertChecked($field, $value = null) { $element = $this->resolver->resolveForChecking($field, $value); PHPUnit::assertTrue( $element->isSelected(), "Expected checkbox [{$field}] to be checked, but it wasn't." ); return $this; }
[ "public", "function", "assertChecked", "(", "$", "field", ",", "$", "value", "=", "null", ")", "{", "$", "element", "=", "$", "this", "->", "resolver", "->", "resolveForChecking", "(", "$", "field", ",", "$", "value", ")", ";", "PHPUnit", "::", "assert...
Assert that the given checkbox field is checked. @param string $field @param string $value @return $this
[ "Assert", "that", "the", "given", "checkbox", "field", "is", "checked", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L352-L362
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertNotChecked
public function assertNotChecked($field, $value = null) { $element = $this->resolver->resolveForChecking($field, $value); PHPUnit::assertFalse( $element->isSelected(), "Checkbox [{$field}] was unexpectedly checked." ); return $this; }
php
public function assertNotChecked($field, $value = null) { $element = $this->resolver->resolveForChecking($field, $value); PHPUnit::assertFalse( $element->isSelected(), "Checkbox [{$field}] was unexpectedly checked." ); return $this; }
[ "public", "function", "assertNotChecked", "(", "$", "field", ",", "$", "value", "=", "null", ")", "{", "$", "element", "=", "$", "this", "->", "resolver", "->", "resolveForChecking", "(", "$", "field", ",", "$", "value", ")", ";", "PHPUnit", "::", "ass...
Assert that the given checkbox field is not checked. @param string $field @param string $value @return $this
[ "Assert", "that", "the", "given", "checkbox", "field", "is", "not", "checked", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L371-L381
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertRadioSelected
public function assertRadioSelected($field, $value) { $element = $this->resolver->resolveForRadioSelection($field, $value); PHPUnit::assertTrue( $element->isSelected(), "Expected radio [{$field}] to be selected, but it wasn't." ); return $this; }
php
public function assertRadioSelected($field, $value) { $element = $this->resolver->resolveForRadioSelection($field, $value); PHPUnit::assertTrue( $element->isSelected(), "Expected radio [{$field}] to be selected, but it wasn't." ); return $this; }
[ "public", "function", "assertRadioSelected", "(", "$", "field", ",", "$", "value", ")", "{", "$", "element", "=", "$", "this", "->", "resolver", "->", "resolveForRadioSelection", "(", "$", "field", ",", "$", "value", ")", ";", "PHPUnit", "::", "assertTrue"...
Assert that the given radio field is selected. @param string $field @param string $value @return $this
[ "Assert", "that", "the", "given", "radio", "field", "is", "selected", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L390-L400
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertRadioNotSelected
public function assertRadioNotSelected($field, $value = null) { $element = $this->resolver->resolveForRadioSelection($field, $value); PHPUnit::assertFalse( $element->isSelected(), "Radio [{$field}] was unexpectedly selected." ); return $this; }
php
public function assertRadioNotSelected($field, $value = null) { $element = $this->resolver->resolveForRadioSelection($field, $value); PHPUnit::assertFalse( $element->isSelected(), "Radio [{$field}] was unexpectedly selected." ); return $this; }
[ "public", "function", "assertRadioNotSelected", "(", "$", "field", ",", "$", "value", "=", "null", ")", "{", "$", "element", "=", "$", "this", "->", "resolver", "->", "resolveForRadioSelection", "(", "$", "field", ",", "$", "value", ")", ";", "PHPUnit", ...
Assert that the given radio field is not selected. @param string $field @param string $value @return $this
[ "Assert", "that", "the", "given", "radio", "field", "is", "not", "selected", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L409-L419
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertSelected
public function assertSelected($field, $value) { PHPUnit::assertTrue( $this->selected($field, $value), "Expected value [{$value}] to be selected for [{$field}], but it wasn't." ); return $this; }
php
public function assertSelected($field, $value) { PHPUnit::assertTrue( $this->selected($field, $value), "Expected value [{$value}] to be selected for [{$field}], but it wasn't." ); return $this; }
[ "public", "function", "assertSelected", "(", "$", "field", ",", "$", "value", ")", "{", "PHPUnit", "::", "assertTrue", "(", "$", "this", "->", "selected", "(", "$", "field", ",", "$", "value", ")", ",", "\"Expected value [{$value}] to be selected for [{$field}],...
Assert that the given select field has the given value selected. @param string $field @param string $value @return $this
[ "Assert", "that", "the", "given", "select", "field", "has", "the", "given", "value", "selected", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L428-L436
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertNotSelected
public function assertNotSelected($field, $value) { PHPUnit::assertFalse( $this->selected($field, $value), "Unexpected value [{$value}] selected for [{$field}]." ); return $this; }
php
public function assertNotSelected($field, $value) { PHPUnit::assertFalse( $this->selected($field, $value), "Unexpected value [{$value}] selected for [{$field}]." ); return $this; }
[ "public", "function", "assertNotSelected", "(", "$", "field", ",", "$", "value", ")", "{", "PHPUnit", "::", "assertFalse", "(", "$", "this", "->", "selected", "(", "$", "field", ",", "$", "value", ")", ",", "\"Unexpected value [{$value}] selected for [{$field}]....
Assert that the given select field does not have the given value selected. @param string $field @param string $value @return $this
[ "Assert", "that", "the", "given", "select", "field", "does", "not", "have", "the", "given", "value", "selected", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L445-L453
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertSelectHasOptions
public function assertSelectHasOptions($field, array $values) { $options = $this->resolver->resolveSelectOptions($field, $values); $options = collect($options)->unique(function (RemoteWebElement $option) { return $option->getAttribute('value'); })->all(); PHPUnit::asser...
php
public function assertSelectHasOptions($field, array $values) { $options = $this->resolver->resolveSelectOptions($field, $values); $options = collect($options)->unique(function (RemoteWebElement $option) { return $option->getAttribute('value'); })->all(); PHPUnit::asser...
[ "public", "function", "assertSelectHasOptions", "(", "$", "field", ",", "array", "$", "values", ")", "{", "$", "options", "=", "$", "this", "->", "resolver", "->", "resolveSelectOptions", "(", "$", "field", ",", "$", "values", ")", ";", "$", "options", "...
Assert that the given array of values are available to be selected. @param string $field @param array $values @return $this
[ "Assert", "that", "the", "given", "array", "of", "values", "are", "available", "to", "be", "selected", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L462-L476
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertSelectMissingOptions
public function assertSelectMissingOptions($field, array $values) { PHPUnit::assertCount( 0, $this->resolver->resolveSelectOptions($field, $values), 'Unexpected options ['.implode(',', $values)."] for selection field [{$field}]." ); return $this; }
php
public function assertSelectMissingOptions($field, array $values) { PHPUnit::assertCount( 0, $this->resolver->resolveSelectOptions($field, $values), 'Unexpected options ['.implode(',', $values)."] for selection field [{$field}]." ); return $this; }
[ "public", "function", "assertSelectMissingOptions", "(", "$", "field", ",", "array", "$", "values", ")", "{", "PHPUnit", "::", "assertCount", "(", "0", ",", "$", "this", "->", "resolver", "->", "resolveSelectOptions", "(", "$", "field", ",", "$", "values", ...
Assert that the given array of values are not available to be selected. @param string $field @param array $values @return $this
[ "Assert", "that", "the", "given", "array", "of", "values", "are", "not", "available", "to", "be", "selected", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L485-L493
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.selected
public function selected($field, $value) { $options = $this->resolver->resolveSelectOptions($field, (array) $value); return collect($options)->contains(function (RemoteWebElement $option) { return $option->isSelected(); }); }
php
public function selected($field, $value) { $options = $this->resolver->resolveSelectOptions($field, (array) $value); return collect($options)->contains(function (RemoteWebElement $option) { return $option->isSelected(); }); }
[ "public", "function", "selected", "(", "$", "field", ",", "$", "value", ")", "{", "$", "options", "=", "$", "this", "->", "resolver", "->", "resolveSelectOptions", "(", "$", "field", ",", "(", "array", ")", "$", "value", ")", ";", "return", "collect", ...
Determine if the given value is selected for the given select field. @param string $field @param string $value @return bool
[ "Determine", "if", "the", "given", "value", "is", "selected", "for", "the", "given", "select", "field", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L526-L533
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertValue
public function assertValue($selector, $value) { $actual = $this->resolver->findOrFail($selector)->getAttribute('value'); PHPUnit::assertEquals($value, $actual); return $this; }
php
public function assertValue($selector, $value) { $actual = $this->resolver->findOrFail($selector)->getAttribute('value'); PHPUnit::assertEquals($value, $actual); return $this; }
[ "public", "function", "assertValue", "(", "$", "selector", ",", "$", "value", ")", "{", "$", "actual", "=", "$", "this", "->", "resolver", "->", "findOrFail", "(", "$", "selector", ")", "->", "getAttribute", "(", "'value'", ")", ";", "PHPUnit", "::", "...
Assert that the element at the given selector has the given value. @param string $selector @param string $value @return $this
[ "Assert", "that", "the", "element", "at", "the", "given", "selector", "has", "the", "given", "value", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L542-L549
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertVisible
public function assertVisible($selector) { $fullSelector = $this->resolver->format($selector); PHPUnit::assertTrue( $this->resolver->findOrFail($selector)->isDisplayed(), "Element [{$fullSelector}] is not visible." ); return $this; }
php
public function assertVisible($selector) { $fullSelector = $this->resolver->format($selector); PHPUnit::assertTrue( $this->resolver->findOrFail($selector)->isDisplayed(), "Element [{$fullSelector}] is not visible." ); return $this; }
[ "public", "function", "assertVisible", "(", "$", "selector", ")", "{", "$", "fullSelector", "=", "$", "this", "->", "resolver", "->", "format", "(", "$", "selector", ")", ";", "PHPUnit", "::", "assertTrue", "(", "$", "this", "->", "resolver", "->", "find...
Assert that the element with the given selector is visible. @param string $selector @return $this
[ "Assert", "that", "the", "element", "with", "the", "given", "selector", "is", "visible", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L557-L567
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertPresent
public function assertPresent($selector) { $fullSelector = $this->resolver->format($selector); PHPUnit::assertTrue( ! is_null($this->resolver->find($selector)), "Element [{$fullSelector}] is not present." ); return $this; }
php
public function assertPresent($selector) { $fullSelector = $this->resolver->format($selector); PHPUnit::assertTrue( ! is_null($this->resolver->find($selector)), "Element [{$fullSelector}] is not present." ); return $this; }
[ "public", "function", "assertPresent", "(", "$", "selector", ")", "{", "$", "fullSelector", "=", "$", "this", "->", "resolver", "->", "format", "(", "$", "selector", ")", ";", "PHPUnit", "::", "assertTrue", "(", "!", "is_null", "(", "$", "this", "->", ...
Assert that the element with the given selector is present in the DOM. @param string $selector @return $this
[ "Assert", "that", "the", "element", "with", "the", "given", "selector", "is", "present", "in", "the", "DOM", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L575-L585
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertMissing
public function assertMissing($selector) { $fullSelector = $this->resolver->format($selector); try { $missing = ! $this->resolver->findOrFail($selector)->isDisplayed(); } catch (NoSuchElementException $e) { $missing = true; } PHPUnit::assertTrue($mis...
php
public function assertMissing($selector) { $fullSelector = $this->resolver->format($selector); try { $missing = ! $this->resolver->findOrFail($selector)->isDisplayed(); } catch (NoSuchElementException $e) { $missing = true; } PHPUnit::assertTrue($mis...
[ "public", "function", "assertMissing", "(", "$", "selector", ")", "{", "$", "fullSelector", "=", "$", "this", "->", "resolver", "->", "format", "(", "$", "selector", ")", ";", "try", "{", "$", "missing", "=", "!", "$", "this", "->", "resolver", "->", ...
Assert that the element with the given selector is not on the page. @param string $selector @return $this
[ "Assert", "that", "the", "element", "with", "the", "given", "selector", "is", "not", "on", "the", "page", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L593-L606
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertDialogOpened
public function assertDialogOpened($message) { $actualMessage = $this->driver->switchTo()->alert()->getText(); PHPUnit::assertEquals( $message, $actualMessage, "Expected dialog message [{$message}] does not equal actual message [{$actualMessage}]." ); return...
php
public function assertDialogOpened($message) { $actualMessage = $this->driver->switchTo()->alert()->getText(); PHPUnit::assertEquals( $message, $actualMessage, "Expected dialog message [{$message}] does not equal actual message [{$actualMessage}]." ); return...
[ "public", "function", "assertDialogOpened", "(", "$", "message", ")", "{", "$", "actualMessage", "=", "$", "this", "->", "driver", "->", "switchTo", "(", ")", "->", "alert", "(", ")", "->", "getText", "(", ")", ";", "PHPUnit", "::", "assertEquals", "(", ...
Assert that a JavaScript dialog with given message has been opened. @param string $message @return $this
[ "Assert", "that", "a", "JavaScript", "dialog", "with", "given", "message", "has", "been", "opened", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L614-L624
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertEnabled
public function assertEnabled($field) { $element = $this->resolver->resolveForField($field); PHPUnit::assertTrue( $element->isEnabled(), "Expected element [{$field}] to be enabled, but it wasn't." ); return $this; }
php
public function assertEnabled($field) { $element = $this->resolver->resolveForField($field); PHPUnit::assertTrue( $element->isEnabled(), "Expected element [{$field}] to be enabled, but it wasn't." ); return $this; }
[ "public", "function", "assertEnabled", "(", "$", "field", ")", "{", "$", "element", "=", "$", "this", "->", "resolver", "->", "resolveForField", "(", "$", "field", ")", ";", "PHPUnit", "::", "assertTrue", "(", "$", "element", "->", "isEnabled", "(", ")",...
Assert that the given field is enabled. @param string $field @return $this
[ "Assert", "that", "the", "given", "field", "is", "enabled", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L632-L642
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertDisabled
public function assertDisabled($field) { $element = $this->resolver->resolveForField($field); PHPUnit::assertFalse( $element->isEnabled(), "Expected element [{$field}] to be disabled, but it wasn't." ); return $this; }
php
public function assertDisabled($field) { $element = $this->resolver->resolveForField($field); PHPUnit::assertFalse( $element->isEnabled(), "Expected element [{$field}] to be disabled, but it wasn't." ); return $this; }
[ "public", "function", "assertDisabled", "(", "$", "field", ")", "{", "$", "element", "=", "$", "this", "->", "resolver", "->", "resolveForField", "(", "$", "field", ")", ";", "PHPUnit", "::", "assertFalse", "(", "$", "element", "->", "isEnabled", "(", ")...
Assert that the given field is disabled. @param string $field @return $this
[ "Assert", "that", "the", "given", "field", "is", "disabled", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L650-L660
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertFocused
public function assertFocused($field) { $element = $this->resolver->resolveForField($field); PHPUnit::assertTrue( $this->driver->switchTo()->activeElement()->equals($element), "Expected element [{$field}] to be focused, but it wasn't." ); return $this; }
php
public function assertFocused($field) { $element = $this->resolver->resolveForField($field); PHPUnit::assertTrue( $this->driver->switchTo()->activeElement()->equals($element), "Expected element [{$field}] to be focused, but it wasn't." ); return $this; }
[ "public", "function", "assertFocused", "(", "$", "field", ")", "{", "$", "element", "=", "$", "this", "->", "resolver", "->", "resolveForField", "(", "$", "field", ")", ";", "PHPUnit", "::", "assertTrue", "(", "$", "this", "->", "driver", "->", "switchTo...
Assert that the given field is focused. @param string $field @return $this
[ "Assert", "that", "the", "given", "field", "is", "focused", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L668-L678
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertNotFocused
public function assertNotFocused($field) { $element = $this->resolver->resolveForField($field); PHPUnit::assertFalse( $this->driver->switchTo()->activeElement()->equals($element), "Expected element [{$field}] not to be focused, but it was." ); return $this; ...
php
public function assertNotFocused($field) { $element = $this->resolver->resolveForField($field); PHPUnit::assertFalse( $this->driver->switchTo()->activeElement()->equals($element), "Expected element [{$field}] not to be focused, but it was." ); return $this; ...
[ "public", "function", "assertNotFocused", "(", "$", "field", ")", "{", "$", "element", "=", "$", "this", "->", "resolver", "->", "resolveForField", "(", "$", "field", ")", ";", "PHPUnit", "::", "assertFalse", "(", "$", "this", "->", "driver", "->", "swit...
Assert that the given field is not focused. @param string $field @return $this
[ "Assert", "that", "the", "given", "field", "is", "not", "focused", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L686-L696
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertVue
public function assertVue($key, $value, $componentSelector = null) { PHPUnit::assertEquals($value, $this->vueAttribute($componentSelector, $key)); return $this; }
php
public function assertVue($key, $value, $componentSelector = null) { PHPUnit::assertEquals($value, $this->vueAttribute($componentSelector, $key)); return $this; }
[ "public", "function", "assertVue", "(", "$", "key", ",", "$", "value", ",", "$", "componentSelector", "=", "null", ")", "{", "PHPUnit", "::", "assertEquals", "(", "$", "value", ",", "$", "this", "->", "vueAttribute", "(", "$", "componentSelector", ",", "...
Assert that the Vue component's attribute at the given key has the given value. @param string $key @param string $value @param string|null $componentSelector @return $this
[ "Assert", "that", "the", "Vue", "component", "s", "attribute", "at", "the", "given", "key", "has", "the", "given", "value", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L706-L711
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertVueIsNot
public function assertVueIsNot($key, $value, $componentSelector = null) { PHPUnit::assertNotEquals($value, $this->vueAttribute($componentSelector, $key)); return $this; }
php
public function assertVueIsNot($key, $value, $componentSelector = null) { PHPUnit::assertNotEquals($value, $this->vueAttribute($componentSelector, $key)); return $this; }
[ "public", "function", "assertVueIsNot", "(", "$", "key", ",", "$", "value", ",", "$", "componentSelector", "=", "null", ")", "{", "PHPUnit", "::", "assertNotEquals", "(", "$", "value", ",", "$", "this", "->", "vueAttribute", "(", "$", "componentSelector", ...
Assert that the Vue component's attribute at the given key does not have the given value. @param string $key @param string $value @param string|null $componentSelector @return $this
[ "Assert", "that", "the", "Vue", "component", "s", "attribute", "at", "the", "given", "key", "does", "not", "have", "the", "given", "value", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L722-L727
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertVueContains
public function assertVueContains($key, $value, $componentSelector = null) { $attribute = $this->vueAttribute($componentSelector, $key); PHPUnit::assertIsArray($attribute, "The attribute for key [$key] is not an array."); PHPUnit::assertContains($value, $attribute); return $this; ...
php
public function assertVueContains($key, $value, $componentSelector = null) { $attribute = $this->vueAttribute($componentSelector, $key); PHPUnit::assertIsArray($attribute, "The attribute for key [$key] is not an array."); PHPUnit::assertContains($value, $attribute); return $this; ...
[ "public", "function", "assertVueContains", "(", "$", "key", ",", "$", "value", ",", "$", "componentSelector", "=", "null", ")", "{", "$", "attribute", "=", "$", "this", "->", "vueAttribute", "(", "$", "componentSelector", ",", "$", "key", ")", ";", "PHPU...
Assert that the Vue component's attribute at the given key is an array that contains the given value. @param string $key @param string $value @param string|null $componentSelector @return $this
[ "Assert", "that", "the", "Vue", "component", "s", "attribute", "at", "the", "given", "key", "is", "an", "array", "that", "contains", "the", "given", "value", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L738-L746
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.assertVueDoesNotContain
public function assertVueDoesNotContain($key, $value, $componentSelector = null) { $attribute = $this->vueAttribute($componentSelector, $key); PHPUnit::assertIsArray($attribute, "The attribute for key [$key] is not an array."); PHPUnit::assertNotContains($value, $attribute); return...
php
public function assertVueDoesNotContain($key, $value, $componentSelector = null) { $attribute = $this->vueAttribute($componentSelector, $key); PHPUnit::assertIsArray($attribute, "The attribute for key [$key] is not an array."); PHPUnit::assertNotContains($value, $attribute); return...
[ "public", "function", "assertVueDoesNotContain", "(", "$", "key", ",", "$", "value", ",", "$", "componentSelector", "=", "null", ")", "{", "$", "attribute", "=", "$", "this", "->", "vueAttribute", "(", "$", "componentSelector", ",", "$", "key", ")", ";", ...
Assert that the Vue component's attribute at the given key is an array that does not contain the given value. @param string $key @param string $value @param string|null $componentSelector @return $this
[ "Assert", "that", "the", "Vue", "component", "s", "attribute", "at", "the", "given", "key", "is", "an", "array", "that", "does", "not", "contain", "the", "given", "value", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L757-L765
train
laravel/dusk
src/Concerns/MakesAssertions.php
MakesAssertions.vueAttribute
public function vueAttribute($componentSelector, $key) { $fullSelector = $this->resolver->format($componentSelector); return $this->driver->executeScript( "return document.querySelector('".$fullSelector."').__vue__.".$key ); }
php
public function vueAttribute($componentSelector, $key) { $fullSelector = $this->resolver->format($componentSelector); return $this->driver->executeScript( "return document.querySelector('".$fullSelector."').__vue__.".$key ); }
[ "public", "function", "vueAttribute", "(", "$", "componentSelector", ",", "$", "key", ")", "{", "$", "fullSelector", "=", "$", "this", "->", "resolver", "->", "format", "(", "$", "componentSelector", ")", ";", "return", "$", "this", "->", "driver", "->", ...
Retrieve the value of the Vue component's attribute at the given key. @param string $componentSelector @param string $key @return mixed
[ "Retrieve", "the", "value", "of", "the", "Vue", "component", "s", "attribute", "at", "the", "given", "key", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/MakesAssertions.php#L774-L781
train
laravel/dusk
src/Concerns/InteractsWithElements.php
InteractsWithElements.clickLink
public function clickLink($link, $element = 'a') { $this->ensurejQueryIsAvailable(); $selector = addslashes(trim($this->resolver->format("{$element}:contains({$link}):visible"))); $this->driver->executeScript("jQuery.find(\"{$selector}\")[0].click();"); return $this; }
php
public function clickLink($link, $element = 'a') { $this->ensurejQueryIsAvailable(); $selector = addslashes(trim($this->resolver->format("{$element}:contains({$link}):visible"))); $this->driver->executeScript("jQuery.find(\"{$selector}\")[0].click();"); return $this; }
[ "public", "function", "clickLink", "(", "$", "link", ",", "$", "element", "=", "'a'", ")", "{", "$", "this", "->", "ensurejQueryIsAvailable", "(", ")", ";", "$", "selector", "=", "addslashes", "(", "trim", "(", "$", "this", "->", "resolver", "->", "for...
Click the link with the given text. @param string $link @param string $element @return $this
[ "Click", "the", "link", "with", "the", "given", "text", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/InteractsWithElements.php#L42-L51
train
laravel/dusk
src/Concerns/InteractsWithElements.php
InteractsWithElements.value
public function value($selector, $value = null) { if (is_null($value)) { return $this->resolver->findOrFail($selector)->getAttribute('value'); } $selector = $this->resolver->format($selector); $this->driver->executeScript( "document.querySelector('{$selector...
php
public function value($selector, $value = null) { if (is_null($value)) { return $this->resolver->findOrFail($selector)->getAttribute('value'); } $selector = $this->resolver->format($selector); $this->driver->executeScript( "document.querySelector('{$selector...
[ "public", "function", "value", "(", "$", "selector", ",", "$", "value", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "value", ")", ")", "{", "return", "$", "this", "->", "resolver", "->", "findOrFail", "(", "$", "selector", ")", "->", "ge...
Directly get or set the value attribute of an input field. @param string $selector @param string|null $value @return $this
[ "Directly", "get", "or", "set", "the", "value", "attribute", "of", "an", "input", "field", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/InteractsWithElements.php#L60-L73
train
laravel/dusk
src/Concerns/InteractsWithElements.php
InteractsWithElements.keys
public function keys($selector, ...$keys) { $this->resolver->findOrFail($selector)->sendKeys($this->parseKeys($keys)); return $this; }
php
public function keys($selector, ...$keys) { $this->resolver->findOrFail($selector)->sendKeys($this->parseKeys($keys)); return $this; }
[ "public", "function", "keys", "(", "$", "selector", ",", "...", "$", "keys", ")", "{", "$", "this", "->", "resolver", "->", "findOrFail", "(", "$", "selector", ")", "->", "sendKeys", "(", "$", "this", "->", "parseKeys", "(", "$", "keys", ")", ")", ...
Send the given keys to the element matching the given selector. @param string $selector @param dynamic $keys @return $this
[ "Send", "the", "given", "keys", "to", "the", "element", "matching", "the", "given", "selector", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/InteractsWithElements.php#L105-L110
train
laravel/dusk
src/Concerns/InteractsWithElements.php
InteractsWithElements.parseKeys
protected function parseKeys($keys) { return collect($keys)->map(function ($key) { if (is_string($key) && Str::startsWith($key, '{') && Str::endsWith($key, '}')) { $key = constant(WebDriverKeys::class.'::'.strtoupper(trim($key, '{}'))); } if (is_array($ke...
php
protected function parseKeys($keys) { return collect($keys)->map(function ($key) { if (is_string($key) && Str::startsWith($key, '{') && Str::endsWith($key, '}')) { $key = constant(WebDriverKeys::class.'::'.strtoupper(trim($key, '{}'))); } if (is_array($ke...
[ "protected", "function", "parseKeys", "(", "$", "keys", ")", "{", "return", "collect", "(", "$", "keys", ")", "->", "map", "(", "function", "(", "$", "key", ")", "{", "if", "(", "is_string", "(", "$", "key", ")", "&&", "Str", "::", "startsWith", "(...
Parse the keys before sending to the keyboard. @param array $keys @return array
[ "Parse", "the", "keys", "before", "sending", "to", "the", "keyboard", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/InteractsWithElements.php#L118-L131
train
laravel/dusk
src/Concerns/InteractsWithElements.php
InteractsWithElements.type
public function type($field, $value) { $this->resolver->resolveForTyping($field)->clear()->sendKeys($value); return $this; }
php
public function type($field, $value) { $this->resolver->resolveForTyping($field)->clear()->sendKeys($value); return $this; }
[ "public", "function", "type", "(", "$", "field", ",", "$", "value", ")", "{", "$", "this", "->", "resolver", "->", "resolveForTyping", "(", "$", "field", ")", "->", "clear", "(", ")", "->", "sendKeys", "(", "$", "value", ")", ";", "return", "$", "t...
Type the given value in the given field. @param string $field @param string $value @return $this
[ "Type", "the", "given", "value", "in", "the", "given", "field", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/InteractsWithElements.php#L140-L145
train
laravel/dusk
src/Concerns/InteractsWithElements.php
InteractsWithElements.append
public function append($field, $value) { $this->resolver->resolveForTyping($field)->sendKeys($value); return $this; }
php
public function append($field, $value) { $this->resolver->resolveForTyping($field)->sendKeys($value); return $this; }
[ "public", "function", "append", "(", "$", "field", ",", "$", "value", ")", "{", "$", "this", "->", "resolver", "->", "resolveForTyping", "(", "$", "field", ")", "->", "sendKeys", "(", "$", "value", ")", ";", "return", "$", "this", ";", "}" ]
Type the given value in the given field without clearing it. @param string $field @param string $value @return $this
[ "Type", "the", "given", "value", "in", "the", "given", "field", "without", "clearing", "it", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/InteractsWithElements.php#L154-L159
train
laravel/dusk
src/Concerns/InteractsWithElements.php
InteractsWithElements.select
public function select($field, $value = null) { $element = $this->resolver->resolveForSelection($field); $options = $element->findElements(WebDriverBy::cssSelector('option:not([disabled])')); if (is_null($value)) { $options[array_rand($options)]->click(); } else { ...
php
public function select($field, $value = null) { $element = $this->resolver->resolveForSelection($field); $options = $element->findElements(WebDriverBy::cssSelector('option:not([disabled])')); if (is_null($value)) { $options[array_rand($options)]->click(); } else { ...
[ "public", "function", "select", "(", "$", "field", ",", "$", "value", "=", "null", ")", "{", "$", "element", "=", "$", "this", "->", "resolver", "->", "resolveForSelection", "(", "$", "field", ")", ";", "$", "options", "=", "$", "element", "->", "fin...
Select the given value or random value of a drop-down field. @param string $field @param string $value @return $this
[ "Select", "the", "given", "value", "or", "random", "value", "of", "a", "drop", "-", "down", "field", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/InteractsWithElements.php#L181-L200
train
laravel/dusk
src/Concerns/InteractsWithElements.php
InteractsWithElements.radio
public function radio($field, $value) { $this->resolver->resolveForRadioSelection($field, $value)->click(); return $this; }
php
public function radio($field, $value) { $this->resolver->resolveForRadioSelection($field, $value)->click(); return $this; }
[ "public", "function", "radio", "(", "$", "field", ",", "$", "value", ")", "{", "$", "this", "->", "resolver", "->", "resolveForRadioSelection", "(", "$", "field", ",", "$", "value", ")", "->", "click", "(", ")", ";", "return", "$", "this", ";", "}" ]
Select the given value of a radio button field. @param string $field @param string $value @return $this
[ "Select", "the", "given", "value", "of", "a", "radio", "button", "field", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/InteractsWithElements.php#L209-L214
train
laravel/dusk
src/Concerns/InteractsWithElements.php
InteractsWithElements.check
public function check($field, $value = null) { $element = $this->resolver->resolveForChecking($field, $value); if (! $element->isSelected()) { $element->click(); } return $this; }
php
public function check($field, $value = null) { $element = $this->resolver->resolveForChecking($field, $value); if (! $element->isSelected()) { $element->click(); } return $this; }
[ "public", "function", "check", "(", "$", "field", ",", "$", "value", "=", "null", ")", "{", "$", "element", "=", "$", "this", "->", "resolver", "->", "resolveForChecking", "(", "$", "field", ",", "$", "value", ")", ";", "if", "(", "!", "$", "elemen...
Check the given checkbox. @param string $field @param string $value @return $this
[ "Check", "the", "given", "checkbox", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/InteractsWithElements.php#L223-L232
train
laravel/dusk
src/Concerns/InteractsWithElements.php
InteractsWithElements.attach
public function attach($field, $path) { $element = $this->resolver->resolveForAttachment($field); $element->setFileDetector(new LocalFileDetector)->sendKeys($path); return $this; }
php
public function attach($field, $path) { $element = $this->resolver->resolveForAttachment($field); $element->setFileDetector(new LocalFileDetector)->sendKeys($path); return $this; }
[ "public", "function", "attach", "(", "$", "field", ",", "$", "path", ")", "{", "$", "element", "=", "$", "this", "->", "resolver", "->", "resolveForAttachment", "(", "$", "field", ")", ";", "$", "element", "->", "setFileDetector", "(", "new", "LocalFileD...
Attach the given file to the field. @param string $field @param string $path @return $this
[ "Attach", "the", "given", "file", "to", "the", "field", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/InteractsWithElements.php#L259-L266
train
laravel/dusk
src/Concerns/InteractsWithElements.php
InteractsWithElements.pressAndWaitFor
public function pressAndWaitFor($button, $seconds = 5) { $element = $this->resolver->resolveForButtonPress($button); $element->click(); return $this->waitUsing($seconds, 100, function () use ($element) { return $element->isEnabled(); }); }
php
public function pressAndWaitFor($button, $seconds = 5) { $element = $this->resolver->resolveForButtonPress($button); $element->click(); return $this->waitUsing($seconds, 100, function () use ($element) { return $element->isEnabled(); }); }
[ "public", "function", "pressAndWaitFor", "(", "$", "button", ",", "$", "seconds", "=", "5", ")", "{", "$", "element", "=", "$", "this", "->", "resolver", "->", "resolveForButtonPress", "(", "$", "button", ")", ";", "$", "element", "->", "click", "(", "...
Press the button with the given text or name. @param string $button @param int $seconds @return $this
[ "Press", "the", "button", "with", "the", "given", "text", "or", "name", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/InteractsWithElements.php#L288-L297
train
laravel/dusk
src/Concerns/InteractsWithElements.php
InteractsWithElements.drag
public function drag($from, $to) { (new WebDriverActions($this->driver))->dragAndDrop( $this->resolver->findOrFail($from), $this->resolver->findOrFail($to) )->perform(); return $this; }
php
public function drag($from, $to) { (new WebDriverActions($this->driver))->dragAndDrop( $this->resolver->findOrFail($from), $this->resolver->findOrFail($to) )->perform(); return $this; }
[ "public", "function", "drag", "(", "$", "from", ",", "$", "to", ")", "{", "(", "new", "WebDriverActions", "(", "$", "this", "->", "driver", ")", ")", "->", "dragAndDrop", "(", "$", "this", "->", "resolver", "->", "findOrFail", "(", "$", "from", ")", ...
Drag an element to another element using selectors. @param string $from @param string $to @return $this
[ "Drag", "an", "element", "to", "another", "element", "using", "selectors", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/InteractsWithElements.php#L306-L313
train
laravel/dusk
src/Concerns/InteractsWithElements.php
InteractsWithElements.dragOffset
public function dragOffset($selector, $x = 0, $y = 0) { (new WebDriverActions($this->driver))->dragAndDropBy( $this->resolver->findOrFail($selector), $x, $y )->perform(); return $this; }
php
public function dragOffset($selector, $x = 0, $y = 0) { (new WebDriverActions($this->driver))->dragAndDropBy( $this->resolver->findOrFail($selector), $x, $y )->perform(); return $this; }
[ "public", "function", "dragOffset", "(", "$", "selector", ",", "$", "x", "=", "0", ",", "$", "y", "=", "0", ")", "{", "(", "new", "WebDriverActions", "(", "$", "this", "->", "driver", ")", ")", "->", "dragAndDropBy", "(", "$", "this", "->", "resolv...
Drag an element by the given offset. @param string $selector @param int $x @param int $y @return $this
[ "Drag", "an", "element", "by", "the", "given", "offset", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Concerns/InteractsWithElements.php#L371-L378
train
laravel/dusk
src/Browser.php
Browser.onWithoutAssert
public function onWithoutAssert($page) { $this->page = $page; // Here we will set the page elements on the resolver instance, which will allow // the developer to access short-cuts for CSS selectors on the page which can // allow for more expressive navigation and interaction with a...
php
public function onWithoutAssert($page) { $this->page = $page; // Here we will set the page elements on the resolver instance, which will allow // the developer to access short-cuts for CSS selectors on the page which can // allow for more expressive navigation and interaction with a...
[ "public", "function", "onWithoutAssert", "(", "$", "page", ")", "{", "$", "this", "->", "page", "=", "$", "page", ";", "// Here we will set the page elements on the resolver instance, which will allow", "// the developer to access short-cuts for CSS selectors on the page which can"...
Set the current page object without executing the assertions. @param mixed $page @return $this
[ "Set", "the", "current", "page", "object", "without", "executing", "the", "assertions", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Browser.php#L183-L195
train
laravel/dusk
src/Browser.php
Browser.resize
public function resize($width, $height) { $this->driver->manage()->window()->setSize( new WebDriverDimension($width, $height) ); return $this; }
php
public function resize($width, $height) { $this->driver->manage()->window()->setSize( new WebDriverDimension($width, $height) ); return $this; }
[ "public", "function", "resize", "(", "$", "width", ",", "$", "height", ")", "{", "$", "this", "->", "driver", "->", "manage", "(", ")", "->", "window", "(", ")", "->", "setSize", "(", "new", "WebDriverDimension", "(", "$", "width", ",", "$", "height"...
Resize the browser window. @param int $width @param int $height @return $this
[ "Resize", "the", "browser", "window", "." ]
a6ac3e6489dc774445aa9459cdc332104591634a
https://github.com/laravel/dusk/blob/a6ac3e6489dc774445aa9459cdc332104591634a/src/Browser.php#L240-L247
train