setUrl() public method

set the absolute redirect url
Since: 3.0.0
public setUrl ( string $text = null, string $url = null ) : Messenger
$text string text of the action
$url string absolute url of the action
return Messenger
Example #1
0
 /**
  * show the error
  *
  * @since 3.0.0
  *
  * @param array $errorArray array of the error
  *
  * @return string
  */
 protected function _error($errorArray = [])
 {
     $messenger = new Messenger($this->_registry);
     return $messenger->setUrl($this->_language->get('back'), $errorArray['url'])->error($errorArray['message'], $errorArray['title']);
 }
Example #2
0
 /**
  * testRender
  *
  * @since 3.0.0
  *
  * @param array $render
  * @param array $actionArray
  * @param string $expect
  *
  * @dataProvider providerRender
  */
 public function testRender($render = null, $actionArray = null, $expect = null)
 {
     /* setup */
     $messenger = new Messenger($this->_registry);
     $messenger->init();
     $messenger->setUrl($actionArray['text'], $actionArray['url'])->doRedirect($actionArray['timeout']);
     /* actual */
     $actual = $messenger->render($render['type'], $render['message'], $render['title']);
     /* compare */
     $this->assertEquals($expect, $actual);
 }