@@ -32,7 +32,7 @@ public function testToStringContainsProperties()
32
32
{
33
33
$ channel = 'test Channel ' ; // invalid channel name to test url encoding of the channel
34
34
35
- $ transport = new SlackTransport ('xoxTestToken ' , $ channel , $ this ->createMock (HttpClientInterface::class));
35
+ $ transport = new SlackTransport ('xoxb-TestToken ' , $ channel , $ this ->createMock (HttpClientInterface::class));
36
36
$ transport ->setHost ('host.test ' );
37
37
38
38
$ this ->assertSame ('slack://host.test?channel=test+Channel ' , (string ) $ transport );
@@ -41,22 +41,22 @@ public function testToStringContainsProperties()
41
41
public function testInstatiatingWithAnInvalidSlackTokenThrowsInvalidArgumentException ()
42
42
{
43
43
$ this ->expectException (InvalidArgumentException::class);
44
- $ this ->expectExceptionMessage ('A valid Slack token needs to start with "xox ". See https://api.slack.com/authentication/token-types for further information. ' );
44
+ $ this ->expectExceptionMessage ('A valid Slack token needs to start with "xoxb-", "xoxp-" or "xoxa-2 ". See https://api.slack.com/authentication/token-types for further information. ' );
45
45
46
46
new SlackTransport ('token ' , 'testChannel ' , $ this ->createMock (HttpClientInterface::class));
47
47
}
48
48
49
49
public function testSupportsChatMessage ()
50
50
{
51
- $ transport = new SlackTransport ('xoxTestToken ' , 'testChannel ' , $ this ->createMock (HttpClientInterface::class));
51
+ $ transport = new SlackTransport ('xoxb-TestToken ' , 'testChannel ' , $ this ->createMock (HttpClientInterface::class));
52
52
53
53
$ this ->assertTrue ($ transport ->supports (new ChatMessage ('testChatMessage ' )));
54
54
$ this ->assertFalse ($ transport ->supports ($ this ->createMock (MessageInterface::class)));
55
55
}
56
56
57
57
public function testSendNonChatMessageThrowsLogicException ()
58
58
{
59
- $ transport = new SlackTransport ('xoxTestToken ' , 'testChannel ' , $ this ->createMock (HttpClientInterface::class));
59
+ $ transport = new SlackTransport ('xoxb-TestToken ' , 'testChannel ' , $ this ->createMock (HttpClientInterface::class));
60
60
61
61
$ this ->expectException (UnsupportedMessageTypeException::class);
62
62
@@ -79,7 +79,7 @@ public function testSendWithEmptyArrayResponseThrows()
79
79
return $ response ;
80
80
});
81
81
82
- $ transport = new SlackTransport ('xoxTestToken ' , 'testChannel ' , $ client );
82
+ $ transport = new SlackTransport ('xoxb-TestToken ' , 'testChannel ' , $ client );
83
83
84
84
$ transport ->send (new ChatMessage ('testMessage ' ));
85
85
}
@@ -102,14 +102,14 @@ public function testSendWithErrorResponseThrows()
102
102
return $ response ;
103
103
});
104
104
105
- $ transport = new SlackTransport ('xoxTestToken ' , 'testChannel ' , $ client );
105
+ $ transport = new SlackTransport ('xoxb-TestToken ' , 'testChannel ' , $ client );
106
106
107
107
$ transport ->send (new ChatMessage ('testMessage ' ));
108
108
}
109
109
110
110
public function testSendWithOptions ()
111
111
{
112
- $ token = 'xoxTestToken ' ;
112
+ $ token = 'xoxb-TestToken ' ;
113
113
$ channel = 'testChannel ' ;
114
114
$ message = 'testMessage ' ;
115
115
@@ -138,7 +138,7 @@ public function testSendWithOptions()
138
138
139
139
public function testSendWithNotification ()
140
140
{
141
- $ token = 'xoxTestToken ' ;
141
+ $ token = 'xoxb-TestToken ' ;
142
142
$ channel = 'testChannel ' ;
143
143
$ message = 'testMessage ' ;
144
144
@@ -181,14 +181,14 @@ public function testSendWithInvalidOptions()
181
181
return $ this ->createMock (ResponseInterface::class);
182
182
});
183
183
184
- $ transport = new SlackTransport ('xoxTestToken ' , 'testChannel ' , $ client );
184
+ $ transport = new SlackTransport ('xoxb-TestToken ' , 'testChannel ' , $ client );
185
185
186
186
$ transport ->send (new ChatMessage ('testMessage ' , $ this ->createMock (MessageOptionsInterface::class)));
187
187
}
188
188
189
189
public function testSendWith200ResponseButNotOk ()
190
190
{
191
- $ token = 'xoxTestToken ' ;
191
+ $ token = 'xoxb-TestToken ' ;
192
192
$ channel = 'testChannel ' ;
193
193
$ message = 'testMessage ' ;
194
194
0 commit comments