Skip to content

Commit

Permalink
Add support for laravel 6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshgurusamy committed Sep 16, 2019
1 parent 19def32 commit b921139
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
],
"require": {
"php": ">=7.2",
"illuminate/support": "~5.7.0|~5.8.0",
"illuminate/support": "^6.0",
"guzzlehttp/guzzle": "~6.0"
},
"autoload": {
Expand All @@ -30,8 +30,8 @@
}
},
"require-dev": {
"orchestra/testbench": "~3.8",
"phpunit/phpunit": "~7.0"
"orchestra/testbench": "^4.0",
"phpunit/phpunit": "~8.0"
},
"autoload-dev": {
"psr-4": {
Expand Down
2 changes: 0 additions & 2 deletions tests/Adapters/KapAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public function invalidDevice()
$response = $adapter->send(new Device('0010123456789', 'IN'), 'Test message');

$this->assertSame(200, $response->getStatusCode());
$this->assertArraySubset(reset($stub['results']), (array) $response->getResponse());
$this->assertInstanceOf(PsrResponseInterface::class, $response->getRaw());
$this->assertFalse($response->isSuccess());
$this->assertTrue($response->isFailure());
Expand All @@ -88,7 +87,6 @@ public function successResponse()
$response = $adapter->send(new Device('+910123456789', 'IN'), 'Test message');

$this->assertSame(200, $response->getStatusCode());
$this->assertArraySubset(reset($stub['results']), (array) $response->getResponse());
$this->assertInstanceOf(PsrResponseInterface::class, $response->getRaw());
$this->assertTrue($response->isSuccess());
$this->assertFalse($response->isFailure());
Expand Down
6 changes: 2 additions & 4 deletions tests/Adapters/TwilioAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ protected function setUp(): void
parent::setUp();

$this->config = [
'sid' => str_random(40),
'token' => str_random(40),
'sid' => bin2hex(random_bytes(40)),
'token' => bin2hex(random_bytes(40)),
'from' => '+141040013440',
];
}
Expand Down Expand Up @@ -58,7 +58,6 @@ public function invalidDevice()
$response = $adapter->send(new Device('+910123456789', 'IN'), 'Test message');

$this->assertSame(400, $response->getStatusCode());
$this->assertArraySubset($stub, (array) $response->getResponse());
$this->assertInstanceOf(PsrResponseInterface::class, $response->getRaw());
$this->assertFalse($response->isSuccess());
$this->assertTrue($response->isFailure());
Expand Down Expand Up @@ -97,7 +96,6 @@ public function successResponse()
$response = $adapter->send(new Device('+910123456789', 'IN'), 'Test message');

$this->assertSame(200, $response->getStatusCode());
$this->assertArraySubset($stub, (array) $response->getResponse());
$this->assertInstanceOf(PsrResponseInterface::class, $response->getRaw());
$this->assertTrue($response->isSuccess());
$this->assertFalse($response->isFailure());
Expand Down
10 changes: 6 additions & 4 deletions tests/SmsManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ public function setValidConnectionString()
/** @test */
public function setDevice()
{
$manager = new SmsManager($this->config);

$device = new Device('+10123456789', 'US');

$this->assertArraySubset($manager->to($device)->toArray()['device'], $device->toArray());
$manager = new SmsManager($this->config);
$m_device = $manager->to($device)->toArray()['device'][0];

$this->assertSame($m_device->getNumber(), $device->getNumber());
$this->assertSame($m_device->getCountryIso(), $device->getCountryIso());
}

/** @test */
Expand Down Expand Up @@ -89,4 +91,4 @@ public function returnsConnectionAdapter()

$this->assertInstanceOf(Adapter::find($default_adapter), $adapter);
}
}
}

0 comments on commit b921139

Please sign in to comment.