info() 공개 메소드

Display an info typed alert message with a text and an optional title.
public info ( string $text, string $title = '' ) : SweetAlertNotifier
$text string
$title string
리턴 SweetAlertNotifier $this
예제 #1
0
 /** @test */
 public function it_flashes_config_for_a_info_alert()
 {
     $session = m::mock(SessionStore::class);
     $notifier = new SweetAlertNotifier($session);
     $expectedConfig = ['timer' => 1800, 'title' => 'Alert', 'text' => 'Info Alert!', 'showConfirmButton' => false, 'type' => 'info'];
     $expectedJsonConfig = json_encode($expectedConfig);
     $session->shouldReceive('flash')->with('sweet_alert.timer', $expectedConfig['timer']);
     $session->shouldReceive('flash')->with('sweet_alert.showConfirmButton', $expectedConfig['showConfirmButton']);
     $session->shouldReceive('flash')->with('sweet_alert.title', $expectedConfig['title']);
     $session->shouldReceive('flash')->with('sweet_alert.text', $expectedConfig['text']);
     $session->shouldReceive('flash')->with('sweet_alert.type', $expectedConfig['type']);
     $session->shouldReceive('flash')->with('sweet_alert.alert', $expectedJsonConfig);
     $notifier->info('Info Alert!', 'Alert');
     $this->assertEquals($expectedConfig, $notifier->getConfig());
     $this->assertEquals($expectedJsonConfig, $notifier->getJsonConfig());
 }
예제 #2
0
 /**
  * Display an info typed alert message with a text and an optional title.
  *
  * @param string $text
  * @param string $title
  * @return \UxWeb\SweetAlert\SweetAlertNotifier $this
  * @static 
  */
 public static function info($text, $title = '')
 {
     return \UxWeb\SweetAlert\SweetAlertNotifier::info($text, $title);
 }