Redaxscript\Messenger::init PHP Метод

init() публичный Метод

init the class
С версии: 3.0.0
public init ( array $optionArray = [] ) : Messenger
$optionArray array options of the messenger
Результат Messenger
    public function init($optionArray = [])
    {
        if (is_array($optionArray)) {
            $this->_optionArray = array_merge($this->_optionArray, $optionArray);
        }
        return $this;
    }

Usage 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);
 }