Skip to content

Commit

Permalink
Apply fixes from StyleCI (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpociot authored Jan 19, 2018
1 parent cc03f9c commit f37304e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
9 changes: 5 additions & 4 deletions src/WebDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace BotMan\Drivers\Web;

use BotMan\BotMan\Messages\Attachments\Audio;
use BotMan\BotMan\Messages\Attachments\Image;
use BotMan\BotMan\Messages\Attachments\Video;
use BotMan\BotMan\Users\User;
use Illuminate\Support\Collection;
use BotMan\BotMan\Drivers\HttpDriver;
use BotMan\BotMan\Interfaces\WebAccess;
use BotMan\BotMan\Messages\Incoming\Answer;
use BotMan\BotMan\Messages\Attachments\Audio;
use BotMan\BotMan\Messages\Attachments\Image;
use BotMan\BotMan\Messages\Attachments\Video;
use BotMan\BotMan\Messages\Outgoing\Question;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
Expand Down Expand Up @@ -248,7 +248,8 @@ protected function addAttachments($incomingMessage)
* @param string $mime
* @return string
*/
protected function getDataURI($file, $mime = '') {
protected function getDataURI($file, $mime = '')
{
return 'data: '.(function_exists('mime_content_type') ? mime_content_type($file) : $mime).';base64,'.base64_encode(file_get_contents($file));
}
}
19 changes: 10 additions & 9 deletions tests/WebDriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ private function getDriver($responseData, $htmlInterface = null)

return new WebDriver($request, $config, $htmlInterface);
}

/**
* @param $responseData
* @param array $files
Expand Down Expand Up @@ -123,9 +124,9 @@ public function it_returns_images()
'file1' => [
'name' => 'MyFile.png',
'type' => 'image/png',
'tmp_name' => __DIR__ . '/fixtures/image.png',
'size' => 1234
]
'tmp_name' => __DIR__.'/fixtures/image.png',
'size' => 1234,
],
]);
/** @var IncomingMessage $message */
$message = $driver->getMessages()[0];
Expand All @@ -146,9 +147,9 @@ public function it_returns_videos()
'file1' => [
'name' => 'MyFile.png',
'type' => 'image/png',
'tmp_name' => __DIR__ . '/fixtures/video.mp4',
'size' => 1234
]
'tmp_name' => __DIR__.'/fixtures/video.mp4',
'size' => 1234,
],
]);
/** @var IncomingMessage $message */
$message = $driver->getMessages()[0];
Expand All @@ -169,9 +170,9 @@ public function it_returns_audio()
'file1' => [
'name' => 'MyFile.png',
'type' => 'image/png',
'tmp_name' => __DIR__ . '/fixtures/audio.mp3',
'size' => 1234
]
'tmp_name' => __DIR__.'/fixtures/audio.mp3',
'size' => 1234,
],
]);
/** @var IncomingMessage $message */
$message = $driver->getMessages()[0];
Expand Down

0 comments on commit f37304e

Please sign in to comment.