Laravel version update

Laravel version update
This commit is contained in:
Manish Verma
2018-08-06 18:48:58 +05:30
parent d143048413
commit 126fbb0255
13678 changed files with 1031482 additions and 778530 deletions

View File

@@ -4,14 +4,14 @@ use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Response;
use LaravelFCM\Sender\FCMSender;
class ResponseTest extends FCMTestCase {
/**
* @test
*/
public function it_send_a_notification_to_a_device()
{
$response = new Response(200, [], '{
class ResponseTest extends FCMTestCase
{
/**
* @test
*/
public function it_send_a_notification_to_a_device()
{
$response = new Response(200, [], '{
"multicast_id": 216,
"success": 3,
"failure": 3,
@@ -19,24 +19,23 @@ class ResponseTest extends FCMTestCase {
"results": [
{ "message_id": "1:0408" }
]
}' );
}');
$client = Mockery::mock(Client::class);
$client->shouldReceive('post')->once()->andReturn($response);
$client = Mockery::mock(Client::class);
$client->shouldReceive('request')->once()->andReturn($response);
$tokens = 'uniqueToken';
$tokens = 'uniqueToken';
$fcm = new FCMSender($client, 'http://test.test');
$fcm->sendTo($tokens);
}
$fcm = new FCMSender($client, 'http://test.test');
$fcm->sendTo($tokens);
}
/**
* @test
*/
public function it_send_a_notification_to_more_than_1000_devices()
{
$response = new Response(200, [], '{
/**
* @test
*/
public function it_send_a_notification_to_more_than_1000_devices()
{
$response = new Response(200, [], '{
"multicast_id": 216,
"success": 3,
"failure": 3,
@@ -49,26 +48,26 @@ class ResponseTest extends FCMTestCase {
{ "message_id": "1:2342", "registration_id": "32" },
{ "error": "NotRegistered"}
]
}' );
}');
$client = Mockery::mock(Client::class);
$client->shouldReceive('post')->times(10)->andReturn($response);
$client = Mockery::mock(Client::class);
$client->shouldReceive('request')->times(10)->andReturn($response);
$tokens = [];
for ($i=0 ; $i<10000 ; $i++) {
$tokens[$i] = 'token_'.$i;
}
$tokens = [];
for ($i = 0; $i < 10000; ++$i) {
$tokens[$i] = 'token_'.$i;
}
$fcm = new FCMSender($client, 'http://test.test');
$fcm->sendTo($tokens);
}
$fcm = new FCMSender($client, 'http://test.test');
$fcm->sendTo($tokens);
}
/**
* @test
*/
public function an_empty_array_of_tokens_thrown_an_exception()
{
$response = new Response(400, [], '{
/**
* @test
*/
public function an_empty_array_of_tokens_thrown_an_exception()
{
$response = new Response(400, [], '{
"multicast_id": 216,
"success": 3,
"failure": 3,
@@ -81,13 +80,13 @@ class ResponseTest extends FCMTestCase {
{ "message_id": "1:2342", "registration_id": "32" },
{ "error": "NotRegistered"}
]
}' );
}');
$client = Mockery::mock(Client::class);
$client->shouldReceive('post')->once()->andReturn($response);
$client = Mockery::mock(Client::class);
$client->shouldReceive('request')->once()->andReturn($response);
$fcm = new FCMSender($client, 'http://test.test');
$this->setExpectedException(\LaravelFCM\Response\Exceptions\InvalidRequestException::class);
$fcm->sendTo([]);
}
}
$fcm = new FCMSender($client, 'http://test.test');
$this->setExpectedException(\LaravelFCM\Response\Exceptions\InvalidRequestException::class);
$fcm->sendTo([]);
}
}