Skip to content

Commit 31e0b8b

Browse files
author
Christoph Rumpel
authored
Merge pull request #37 from christophrumpel/feature/fixStyles
Fix styles
2 parents 9f5b0c2 + 6d28190 commit 31e0b8b

File tree

5 files changed

+12
-27
lines changed

5 files changed

+12
-27
lines changed

src/Exceptions/CouldNotSendNotification.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ public static function serviceRespondedWithAnError($response)
1313

1414
public static function statusUpdateTooLong($exceededLength)
1515
{
16-
return new static("Couldn't post Notification, because the status message was too long by " .
17-
$exceededLength . " character(s).");
16+
return new static("Couldn't post Notification, because the status message was too long by ".$exceededLength.' character(s).');
1817
}
1918
}

tests/TwitterChannelTest.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,17 @@
22

33
namespace NotificationChannels\Twitter\Test;
44

5+
use Mockery;
6+
use stdClass;
7+
use Orchestra\Testbench\TestCase;
58
use Abraham\TwitterOAuth\TwitterOAuth;
69
use Illuminate\Notifications\Notification;
7-
use Mockery;
8-
use NotificationChannels\Twitter\Exceptions\CouldNotSendNotification;
9-
use NotificationChannels\Twitter\Twitter;
1010
use NotificationChannels\Twitter\TwitterChannel;
11-
use NotificationChannels\Twitter\TwitterImage;
1211
use NotificationChannels\Twitter\TwitterStatusUpdate;
13-
use Orchestra\Testbench\TestCase;
14-
use stdClass;
12+
use NotificationChannels\Twitter\Exceptions\CouldNotSendNotification;
1513

1614
class ChannelTest extends TestCase
1715
{
18-
1916
/** @var Mockery\Mock */
2017
protected $twitter;
2118

@@ -73,7 +70,6 @@ public function it_throws_an_exception_when_it_could_not_send_the_notification()
7370
$twitterResponse = new stdClass;
7471
$twitterResponse->errors[] = $messageObject;
7572

76-
7773
$this->twitter->shouldReceive('post')->once()->with('statuses/update',
7874
['status' => 'Laravel Notification Channels are awesome!']);
7975

@@ -87,10 +83,8 @@ public function it_throws_an_exception_when_it_could_not_send_the_notification()
8783
}
8884
}
8985

90-
9186
class TestNotifiable
9287
{
93-
9488
use \Illuminate\Notifications\Notifiable;
9589

9690
/**
@@ -104,7 +98,6 @@ public function routeNotificationForTwitter()
10498

10599
class TestNotification extends Notification
106100
{
107-
108101
public function toTwitter($notifiable)
109102
{
110103
return new TwitterStatusUpdate('Laravel Notification Channels are awesome!');
@@ -113,7 +106,6 @@ public function toTwitter($notifiable)
113106

114107
class TestNotificationWithImage extends Notification
115108
{
116-
117109
public function toTwitter($notifiable)
118110
{
119111
return (new TwitterStatusUpdate('Laravel Notification Channels are awesome!'))->withImage(public_path('image.png'));

tests/TwitterDirectMessageTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ public function it_accepts_receiver_and_message_when_constructed()
2222
$this->assertEquals('myMessage', $this->message->getContent());
2323
}
2424

25-
/** @test */
25+
/** @test */
2626
public function it_can_get_the_content()
2727
{
2828
$this->assertEquals('myMessage', $this->message->getContent());
2929
}
3030

31-
/** @test */
31+
/** @test */
3232
public function it_can_get_the_receiver()
3333
{
3434
$this->assertEquals('receiver', $this->message->getReceiver());
@@ -43,10 +43,10 @@ public function it_can_get_the_api_endpoint()
4343
/** @test */
4444
public function it_can_get_the_request_body()
4545
{
46-
$expected = [
47-
'screen_name' => 'receiver',
48-
'text' => 'myMessage',
49-
];
46+
$expected = [
47+
'screen_name' => 'receiver',
48+
'text' => 'myMessage',
49+
];
5050
$this->assertEquals($expected, $this->message->getRequestBody());
5151
}
5252
}

tests/TwitterImageTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@
77

88
class TwitterImageTest extends TestCase
99
{
10-
1110
/** @test */
1211
public function it_accepts_an_image_path_when_constructing_a_twitter_image()
1312
{
1413
$image = new TwitterImage('/foo/bar/baz.png');
1514
$this->assertEquals('/foo/bar/baz.png', $image->getPath());
1615
}
17-
1816
}
19-

tests/TwitterStatusUpdateTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
namespace NotificationChannels\Twitter\Test;
44

5-
use NotificationChannels\Twitter\Exceptions\CouldNotSendNotification;
65
use NotificationChannels\Twitter\TwitterImage;
76
use NotificationChannels\Twitter\TwitterStatusUpdate;
7+
use NotificationChannels\Twitter\Exceptions\CouldNotSendNotification;
88

99
class TwitterStatusUpdateTest extends \PHPUnit_Framework_TestCase
1010
{
11-
1211
/** @var TwitterStatusUpdate */
1312
protected $message;
1413

@@ -95,7 +94,5 @@ public function it_provides_exceeded_message_count_when_the_status_update_is_too
9594
$this->assertEquals("Couldn't post Notification, because the status message was too long by 1 character(s).",
9695
$e->getMessage());
9796
}
98-
9997
}
100-
10198
}

0 commit comments

Comments
 (0)