Skip to content

Commit 6ec0b7d

Browse files
authored
Merge pull request #3 from flowerpress/bbc.com
Support for Laravel 6+
2 parents cb8faa2 + 45f4d65 commit 6ec0b7d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Agent.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace STS\VisualTesting;
44

5+
use Illuminate\Support\Arr;
56
use Laravel\Dusk\Browser;
67

78
class Agent
@@ -107,7 +108,7 @@ protected function generateName(Browser $browser)
107108
{
108109
$name = str_replace($browser::$baseUrl, '', $browser->driver->getCurrentURL());
109110

110-
$this->generatedNames[$name] = array_get($this->generatedNames, $name, -1) + 1;
111+
$this->generatedNames[$name] = Arr::get($this->generatedNames, $name, -1) + 1;
111112

112113
return $this->generatedNames[$name] == 0
113114
? $name

src/Console/DuskCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace STS\VisualTesting\Console;
44

5+
use Illuminate\Support\Str;
56
use Laravel\Dusk\Console\DuskCommand as BaseDuskCommand;
67
use Symfony\Component\Process\Process;
78
use Symfony\Component\Process\Exception\RuntimeException;
@@ -13,7 +14,7 @@ class DuskCommand extends BaseDuskCommand
1314
*
1415
* @var string
1516
*/
16-
protected $signature = 'dusk
17+
protected $signature = 'dusk
1718
{--without-tty : Disable output to TTY}
1819
{--without-percy : Disable percy snapshots}
1920
{--percy-target-branch= : Set the base branch for comparison}
@@ -91,7 +92,7 @@ protected function process()
9192
protected function processOptions()
9293
{
9394
return array_filter(array_slice($_SERVER['argv'], 2), function($param) {
94-
return !starts_with($param, ['--without-tty', '--without-percy', '--percy-target-branch', '--percy-target-commit']);
95+
return !Str::startsWith($param, ['--without-tty', '--without-percy', '--percy-target-branch', '--percy-target-commit']);
9596
});
9697
}
9798
}

0 commit comments

Comments
 (0)