/** * @test * @dataProvider multiple_buttons */ public function compile_query_string_return_corret_value($buttonNumber) { $button = new AutoRemoteNotificationButton("action", "label with spaces", "icon"); $button->referenceNumber($buttonNumber); $query = $button->compileQueryString(); $this->assertEquals("action{$buttonNumber}=action&action{$buttonNumber}name=label+with+spaces&action{$buttonNumber}icon=icon", $query); }
/** * Add a button for the notification * * @param NotificationButton $button * * @return Notification $this * * @throws LogicException */ public function addButton(AutoRemoteNotificationButton $button) { $this->buttons[] = $button; $count = count($this->buttons); if ($count > 3) { throw new LogicException("Maximum numbers of buttons exceeded"); } $button->referenceNumber($count); return $this; }