/** @test */ public function it_will_add_the_html_option_to_config_when_using_an_html_alert() { $session = m::mock(SessionStore::class); $session->shouldReceive('flash')->atLeast(1); $notifier = new SweetAlertNotifier($session); $expectedConfig = ['timer' => 1800, 'title' => 'Alert', 'text' => '<strong>This should be bold!</strong>', 'showConfirmButton' => false, 'html' => true]; $expectedJsonConfig = json_encode($expectedConfig); $notifier->message('<strong>This should be bold!</strong>', 'Alert')->html(); $this->assertEquals($expectedConfig, $notifier->getConfig()); $this->assertEquals($expectedJsonConfig, $notifier->getJsonConfig()); }
/** * Display an alert message with a text and an optional title. * * By default the alert is not typed. * * @param string $text * @param string $type * @param string $title * @return \UxWeb\SweetAlert\SweetAlertNotifier $this * @static */ public static function message($text, $title = '', $type = null) { return \UxWeb\SweetAlert\SweetAlertNotifier::message($text, $title, $type); }