error() public static method

Checks if the function generates PHP error or throws exception.
public static error ( callable $function, $expectedType, $expectedMessage = NULL ) : null | Exception
$function callable
return null | Exception
Ejemplo n.º 1
0
 public static function assertTypeError($function)
 {
     if (PHP_VERSION_ID < 70000) {
         Assert::error($function, E_RECOVERABLE_ERROR);
     } else {
         Assert::exception($function, '\\TypeError');
     }
 }
Ejemplo n.º 2
0
 /**
  * Checks that the function generate PHP error and does not throw exception.
  * @param callable $function
  * @param string $expectedType
  * @param null|string $expectedMessage
  * @return void
  */
 public function error($function, $expectedType, $expectedMessage = NULL)
 {
     Assert::error($function, $expectedType, $expectedMessage = NULL);
 }