Skip to content

Commit d8145ef

Browse files
Nils LangnerNils Langner
authored andcommitted
extendes bootstrap for tests
1 parent 0c9c64c commit d8145ef

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

module/VisualCeption.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ public function seeVisualChanges($identifier, $elementID = null, $excludeElement
7676
if ($deviationResult["deviation"] <= $this->maximumDeviation) {
7777
$compareScreenshotPath = $this->getDeviationScreenshotPath($identifier);
7878
$deviationResult["deviationImage"]->writeImage($compareScreenshotPath);
79-
throw new ImageDeviationException("The deviation of the taken screenshot is too low (" . $deviationResult["deviation"] . "%).\nSee $compareScreenshotPath for a deviation screenshot.", "pic1", "pic2", $compareScreenshotPath);
79+
throw new ImageDeviationException("The deviation of the taken screenshot is too low (" . $deviationResult["deviation"] . "%).\nSee $compareScreenshotPath for a deviation screenshot.",
80+
$this->getExpectedScreenshotPath($identifier),
81+
$this->getScreenshotPath($identifier),
82+
$compareScreenshotPath);
8083
}
8184
}
8285
}
@@ -99,7 +102,10 @@ public function dontSeeVisualChanges($identifier, $elementID = null, $excludeEle
99102
if ($deviationResult["deviation"] > $this->maximumDeviation) {
100103
$compareScreenshotPath = $this->getDeviationScreenshotPath($identifier);
101104
$deviationResult["deviationImage"]->writeImage($compareScreenshotPath);
102-
throw new ImageDeviationException("The deviation of the taken screenshot is too hight (" . $deviationResult["deviation"] . "%).\nSee $compareScreenshotPath for a deviation screenshot.", "pic1", "pic2", $compareScreenshotPath);
105+
throw new ImageDeviationException("The deviation of the taken screenshot is too hight (" . $deviationResult["deviation"] . "%).\nSee $compareScreenshotPath for a deviation screenshot.",
106+
$this->getExpectedScreenshotPath($identifier),
107+
$this->getScreenshotPath($identifier),
108+
$compareScreenshotPath);
103109
}
104110
}
105111
}

test/integration/tests/_bootstrap.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33

44
sleep(5);
55

6-
include_once __DIR__."/../../../module/VisualCeption.php";
6+
include_once __DIR__."/../../../module/VisualCeption.php";
7+
include_once __DIR__."/../../../module/ImageDeviationException.php";

0 commit comments

Comments
 (0)