error() public method

error message
Since: 3.0.0
public error ( mixed $message = null, string $title = null ) : string
$message mixed message of the error
$title string title of the error
return string
Example #1
0
 /**
  * testError
  *
  * @since 3.0.0
  *
  * @param array $error
  * @param array $actionArray
  * @param string $expect
  *
  * @dataProvider providerError
  */
 public function testError($error = null, $actionArray = null, $expect = null)
 {
     /* setup */
     $messenger = new Messenger($this->_registry);
     $messenger->setRoute($actionArray['text'], $actionArray['route']);
     /* actual */
     $actual = $messenger->error($error['message'], $error['title']);
     /* compare */
     $this->assertEquals($expect, $actual);
 }
Example #2
0
 /**
  * show the error
  *
  * @since 3.0.0
  *
  * @param array $errorArray
  *
  * @return array
  */
 protected function _error($errorArray = [])
 {
     $messenger = new Messenger($this->_registry);
     return $messenger->error($errorArray['message']);
 }