Permalink
Browse files

default assert label

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 3c9cdac878e3d8c2db2c4f634de7dcbf9e013dad
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/Debug/Debug.php
View
@@ -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);
}
}

0 comments on commit 3c9cdac

Please sign in to comment.