Skip to content

Commit

Permalink
default assert label
Browse files Browse the repository at this point in the history
provide a default assert label/message if non provided
default consists of file and line of assert
  • Loading branch information
bkdotcom committed Nov 29, 2017
1 parent 917453a commit 3c9cdac
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Debug/Debug.php
Expand Up @@ -234,6 +234,10 @@ public function assert()
$args = func_get_args();
$test = array_shift($args);
if (!$test) {
if (!$args) {
$callerInfo = $this->utilities->getCallerInfo();
$args[] = 'assertation failed in '.$callerInfo['file'].' on line '.$callerInfo['line'];
}
$this->appendLog('assert', $args);
}
}
Expand Down

0 comments on commit 3c9cdac

Please sign in to comment.