Skip to content

Commit c03bc3f

Browse files
authored
Merge pull request #19 from Treggats/phpunit-fixes
getting tests ready for newer php versions
2 parents 2a22041 + fb89261 commit c03bc3f

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
language: php
22

33
php:
4-
- 7.0
5-
- 7.1
64
- 7.2
75
- 7.3
86

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@
3535
"test": "vendor/bin/phpunit"
3636
},
3737
"config": {
38-
"sort-packages": true
38+
"sort-packages": true,
39+
"platform": {
40+
"php": "7.2.0"
41+
}
3942
},
4043
"minimum-stability": "dev",
4144
"extra": {

tests/MessagebirdChannelTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44

55
use Mockery;
66
use GuzzleHttp\Client;
7+
use PHPUnit\Framework\TestCase;
78
use Illuminate\Notifications\Notifiable;
89
use Illuminate\Notifications\Notification;
910
use NotificationChannels\Messagebird\MessagebirdClient;
1011
use NotificationChannels\Messagebird\MessagebirdChannel;
1112
use NotificationChannels\Messagebird\MessagebirdMessage;
12-
use PHPUnit\Framework\TestCase;
1313

1414
class MessagebirdChannelTest extends TestCase
1515
{
16-
public function setUp()
16+
public function setUp(): void
1717
{
1818
$this->notification = new TestNotification;
1919
$this->string_notification = new TestStringNotification;
@@ -23,7 +23,7 @@ public function setUp()
2323
$this->channel = new MessagebirdChannel($this->client);
2424
}
2525

26-
public function tearDown()
26+
public function tearDown(): void
2727
{
2828
Mockery::close();
2929
parent::tearDown();
@@ -40,14 +40,14 @@ public function it_can_be_instantiated()
4040
public function test_it_shares_message()
4141
{
4242
$this->client->shouldReceive('send')->once();
43-
$this->channel->send($this->notifiable, $this->notification);
43+
$this->assertNull($this->channel->send($this->notifiable, $this->notification));
4444
}
4545

4646
/** @test */
4747
public function if_string_message_can_be_send()
4848
{
4949
$this->client->shouldReceive('send')->once();
50-
$this->channel->send($this->notifiable, $this->string_notification);
50+
$this->assertNull($this->channel->send($this->notifiable, $this->string_notification));
5151
}
5252
}
5353

tests/MessagebirdClientTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44

55
use Mockery;
66
use GuzzleHttp\Client;
7+
use PHPUnit\Framework\TestCase;
78
use NotificationChannels\Messagebird\MessagebirdClient;
89
use NotificationChannels\Messagebird\MessagebirdMessage;
9-
use PHPUnit\Framework\TestCase;
1010

1111
class MessagebirdClientTest extends TestCase
1212
{
13-
public function setUp()
13+
public function setUp(): void
1414
{
1515
$this->guzzle = Mockery::mock(new Client());
1616
$this->client = Mockery::mock(new MessagebirdClient($this->guzzle, 'test_ek1qBbKbHoA20gZHM40RBjxzX'));
1717
$this->message = (new MessagebirdMessage('Message content'))->setOriginator('APPNAME')->setRecipients('31650520659')->setReference('000123');
1818
}
1919

20-
public function tearDown()
20+
public function tearDown(): void
2121
{
2222
Mockery::close();
2323
parent::tearDown();
@@ -33,6 +33,7 @@ public function it_can_be_instantiated()
3333
/** @test */
3434
public function it_can_send_message()
3535
{
36-
$this->client->send($this->message);
36+
$this->client->shouldReceive('send')->with($this->message)->once();
37+
$this->assertNull($this->client->send($this->message));
3738
}
3839
}

0 commit comments

Comments
 (0)