basic() public method

Display a not typed alert message with a text and a title.
public basic ( string $text, string $title ) : SweetAlertNotifier
$text string
$title string
return SweetAlertNotifier $this
 /** @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());
 }
Esempio n. 2
0
 /**
  * Display a not typed alert message with a text and a title.
  *
  * @param string $text
  * @param string $title
  * @return \UxWeb\SweetAlert\SweetAlertNotifier $this
  * @static 
  */
 public static function basic($text, $title)
 {
     return \UxWeb\SweetAlert\SweetAlertNotifier::basic($text, $title);
 }