Skip to content

Commit b921139

Browse files
Add support for laravel 6.x
1 parent 19def32 commit b921139

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
],
2222
"require": {
2323
"php": ">=7.2",
24-
"illuminate/support": "~5.7.0|~5.8.0",
24+
"illuminate/support": "^6.0",
2525
"guzzlehttp/guzzle": "~6.0"
2626
},
2727
"autoload": {
@@ -30,8 +30,8 @@
3030
}
3131
},
3232
"require-dev": {
33-
"orchestra/testbench": "~3.8",
34-
"phpunit/phpunit": "~7.0"
33+
"orchestra/testbench": "^4.0",
34+
"phpunit/phpunit": "~8.0"
3535
},
3636
"autoload-dev": {
3737
"psr-4": {

tests/Adapters/KapAdapterTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ public function invalidDevice()
6161
$response = $adapter->send(new Device('0010123456789', 'IN'), 'Test message');
6262

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

9089
$this->assertSame(200, $response->getStatusCode());
91-
$this->assertArraySubset(reset($stub['results']), (array) $response->getResponse());
9290
$this->assertInstanceOf(PsrResponseInterface::class, $response->getRaw());
9391
$this->assertTrue($response->isSuccess());
9492
$this->assertFalse($response->isFailure());

tests/Adapters/TwilioAdapterTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ protected function setUp(): void
2323
parent::setUp();
2424

2525
$this->config = [
26-
'sid' => str_random(40),
27-
'token' => str_random(40),
26+
'sid' => bin2hex(random_bytes(40)),
27+
'token' => bin2hex(random_bytes(40)),
2828
'from' => '+141040013440',
2929
];
3030
}
@@ -58,7 +58,6 @@ public function invalidDevice()
5858
$response = $adapter->send(new Device('+910123456789', 'IN'), 'Test message');
5959

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

9998
$this->assertSame(200, $response->getStatusCode());
100-
$this->assertArraySubset($stub, (array) $response->getResponse());
10199
$this->assertInstanceOf(PsrResponseInterface::class, $response->getRaw());
102100
$this->assertTrue($response->isSuccess());
103101
$this->assertFalse($response->isFailure());

tests/SmsManagerTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ public function setValidConnectionString()
4949
/** @test */
5050
public function setDevice()
5151
{
52-
$manager = new SmsManager($this->config);
53-
5452
$device = new Device('+10123456789', 'US');
5553

56-
$this->assertArraySubset($manager->to($device)->toArray()['device'], $device->toArray());
54+
$manager = new SmsManager($this->config);
55+
$m_device = $manager->to($device)->toArray()['device'][0];
56+
57+
$this->assertSame($m_device->getNumber(), $device->getNumber());
58+
$this->assertSame($m_device->getCountryIso(), $device->getCountryIso());
5759
}
5860

5961
/** @test */
@@ -89,4 +91,4 @@ public function returnsConnectionAdapter()
8991

9092
$this->assertInstanceOf(Adapter::find($default_adapter), $adapter);
9193
}
92-
}
94+
}

0 commit comments

Comments
 (0)