File tree Expand file tree Collapse file tree 2 files changed +15
-13
lines changed Expand file tree Collapse file tree 2 files changed +15
-13
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace BotMan \Drivers \Web ;
4
4
5
- use BotMan \BotMan \Messages \Attachments \Audio ;
6
- use BotMan \BotMan \Messages \Attachments \Image ;
7
- use BotMan \BotMan \Messages \Attachments \Video ;
8
5
use BotMan \BotMan \Users \User ;
9
6
use Illuminate \Support \Collection ;
10
7
use BotMan \BotMan \Drivers \HttpDriver ;
11
8
use BotMan \BotMan \Interfaces \WebAccess ;
12
9
use BotMan \BotMan \Messages \Incoming \Answer ;
10
+ use BotMan \BotMan \Messages \Attachments \Audio ;
11
+ use BotMan \BotMan \Messages \Attachments \Image ;
12
+ use BotMan \BotMan \Messages \Attachments \Video ;
13
13
use BotMan \BotMan \Messages \Outgoing \Question ;
14
14
use Symfony \Component \HttpFoundation \Request ;
15
15
use Symfony \Component \HttpFoundation \Response ;
@@ -248,7 +248,8 @@ protected function addAttachments($incomingMessage)
248
248
* @param string $mime
249
249
* @return string
250
250
*/
251
- protected function getDataURI ($ file , $ mime = '' ) {
251
+ protected function getDataURI ($ file , $ mime = '' )
252
+ {
252
253
return 'data: ' .(function_exists ('mime_content_type ' ) ? mime_content_type ($ file ) : $ mime ).';base64, ' .base64_encode (file_get_contents ($ file ));
253
254
}
254
255
}
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ private function getDriver($responseData, $htmlInterface = null)
50
50
51
51
return new WebDriver ($ request , $ config , $ htmlInterface );
52
52
}
53
+
53
54
/**
54
55
* @param $responseData
55
56
* @param array $files
@@ -123,9 +124,9 @@ public function it_returns_images()
123
124
'file1 ' => [
124
125
'name ' => 'MyFile.png ' ,
125
126
'type ' => 'image/png ' ,
126
- 'tmp_name ' => __DIR__ . '/fixtures/image.png ' ,
127
- 'size ' => 1234
128
- ]
127
+ 'tmp_name ' => __DIR__ . '/fixtures/image.png ' ,
128
+ 'size ' => 1234 ,
129
+ ],
129
130
]);
130
131
/** @var IncomingMessage $message */
131
132
$ message = $ driver ->getMessages ()[0 ];
@@ -146,9 +147,9 @@ public function it_returns_videos()
146
147
'file1 ' => [
147
148
'name ' => 'MyFile.png ' ,
148
149
'type ' => 'image/png ' ,
149
- 'tmp_name ' => __DIR__ . '/fixtures/video.mp4 ' ,
150
- 'size ' => 1234
151
- ]
150
+ 'tmp_name ' => __DIR__ . '/fixtures/video.mp4 ' ,
151
+ 'size ' => 1234 ,
152
+ ],
152
153
]);
153
154
/** @var IncomingMessage $message */
154
155
$ message = $ driver ->getMessages ()[0 ];
@@ -169,9 +170,9 @@ public function it_returns_audio()
169
170
'file1 ' => [
170
171
'name ' => 'MyFile.png ' ,
171
172
'type ' => 'image/png ' ,
172
- 'tmp_name ' => __DIR__ . '/fixtures/audio.mp3 ' ,
173
- 'size ' => 1234
174
- ]
173
+ 'tmp_name ' => __DIR__ . '/fixtures/audio.mp3 ' ,
174
+ 'size ' => 1234 ,
175
+ ],
175
176
]);
176
177
/** @var IncomingMessage $message */
177
178
$ message = $ driver ->getMessages ()[0 ];
You can’t perform that action at this time.
0 commit comments