Skip to content

Commit f217872

Browse files
committed
chore: Improve output of exceptions
1 parent 63b7b3f commit f217872

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tests/Context/BackendQuestionMarkContext.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ class BackendQuestionMarkContext extends SubContext
1414
*/
1515
public function iShouldSeeACorrectBuildNumber(): void
1616
{
17-
$questionMark = $this->getValidPage(QuestionMarkModule::class);
18-
$buildNr = $questionMark->getBuildNr();
17+
$buildNr = $this->getValidPage(QuestionMarkModule::class)->getBuildNr();
1918
if (!strtotime($buildNr)) {
20-
throw new Exception('Build number wrong');
19+
throw new \RuntimeException(sprintf('Build number "%s" is wrong', $buildNr));
2120
}
2221
}
2322

@@ -26,10 +25,9 @@ public function iShouldSeeACorrectBuildNumber(): void
2625
*/
2726
public function iShouldSeeACorrectVersionNumber(): void
2827
{
29-
$questionMark = $this->getValidPage(QuestionMarkModule::class);
30-
$versionNr = $questionMark->getVersionNr();
28+
$versionNr = $this->getValidPage(QuestionMarkModule::class)->getVersionNr();
3129
if (!version_compare($versionNr, '0.0.1', '>')) {
32-
throw new Exception('Version number wrong!');
30+
throw new \RuntimeException(sprintf('Version number "%s" is wrong', $versionNr));
3331
}
3432
}
3533
}

0 commit comments

Comments
 (0)