/** @test */
 public function it_show_a_cancel_button_with_custom_text()
 {
     $session = m::mock(SessionStore::class);
     $session->shouldReceive('flash')->atLeast(1);
     $notifier = new SweetAlertNotifier($session);
     $expectedConfig = ['title' => 'Alert', 'text' => 'Basic Alert!', 'showConfirmButton' => false, 'showCancelButton' => true, 'cancelButtonText' => 'Cancel!', 'allowOutsideClick' => false];
     $expectedJsonConfig = json_encode($expectedConfig);
     $notifier->basic('Basic Alert!', 'Alert')->cancelButton('Cancel!');
     $this->assertEquals($expectedConfig, $notifier->getConfig());
     $this->assertEquals($expectedJsonConfig, $notifier->getJsonConfig());
 }
示例#2
0
 /**
  * Make Message HTML view.
  *
  * @param bool|true $html
  * @return \UxWeb\SweetAlert\SweetAlertNotifier $this
  * @static 
  */
 public static function html()
 {
     return \UxWeb\SweetAlert\SweetAlertNotifier::html();
 }