init() public method

init the class
Since: 3.0.0
public init ( array $optionArray = [] ) : Messenger
$optionArray array options of the messenger
return Messenger
Example #1
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);
 }