Send message devices registered at a or more topics
public sendToTopic ( |
||
$topics | ||
$options | ||
$notification | ||
$data | ||
Résultat |
/** * @test */ public function it_send_a_notification_to_a_topic_and_return_error() { $response = new Response(200, [], '{"error":"TopicsMessageRateExceeded"}'); $client = Mockery::mock(Client::class); $client->shouldReceive('post')->once()->andReturn($response); $fcm = new FCMSender($client, 'http://test.test'); $topics = new Topics(); $topics->topic('test'); $response = $fcm->sendToTopic($topics); $this->assertFalse($response->isSuccess()); $this->assertTrue($response->shouldRetry()); $this->assertEquals('TopicsMessageRateExceeded', $response->error()); }