DuskVisualDiffTester::setScreenshotOutputPath()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace BeyondCode\VisualDiff;
4
5
use Laravel\Dusk\Browser;
6
7
class DuskVisualDiffTester extends VisualDiffTester
8
{
9
    /** @var Browser */
10
    protected $browser;
11
12
    public function setBrowser(Browser $browser)
13
    {
14
        $this->browser = $browser;
15
16
        return $this;
17
    }
18
19
    protected function createScreenshot()
20
    {
21
        $filename = str_replace('.png', '', $this->getFilename());
22
23
        $this->browser
24
            ->resize($this->currentResolution['width'], $this->currentResolution['height'])
25
            ->screenshot($filename);
26
    }
27
28
    public function setScreenshotOutputPath(string $screenshotOutputPath)
29
    {
30
        parent::setScreenshotOutputPath($screenshotOutputPath);
31
32
        Browser::$storeScreenshotsAt = $screenshotOutputPath;
33
    }
34
}