Skip to content

Commit

Permalink
Apply fixes from StyleCI (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmuscnielsen authored Nov 1, 2017
1 parent 6f81e51 commit d7dfa90
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ protected function disk()
{
return Storage::disk($this->diskName);
}
}
}
4 changes: 2 additions & 2 deletions src/CloudImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class CloudImage implements Arrayable
*/
protected $options = [
'sizing' => [],
'custom' => []
'custom' => [],
];

/**
Expand Down Expand Up @@ -149,4 +149,4 @@ public function setGroup($option, $value)

return $this;
}
}
}
5 changes: 1 addition & 4 deletions src/CloudImagesServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ class CloudImagesServiceProvider extends ServiceProvider
*/
protected $defer = true;

/**
*
*/
public function register()
{
$this->app->register(\Superbalist\LaravelGoogleCloudStorage\GoogleCloudStorageServiceProvider::class);
Expand All @@ -28,7 +25,7 @@ public function register()
public function provides()
{
return [
Client::class
Client::class,
];
}
}
3 changes: 1 addition & 2 deletions src/FailedUploadException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

class FailedUploadException extends \Exception
{

}
}
2 changes: 1 addition & 1 deletion tests/Fakes/FakeGuzzleClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ public function request()
{
return new FakeGuzzleResponse($this->status);
}
}
}
4 changes: 2 additions & 2 deletions tests/Fakes/FakeGuzzleResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct($status)
public function getBody()
{
return json_encode([
'url' => 'http://localhost/somehash'
'url' => 'http://localhost/somehash',
]);
}

Expand All @@ -35,4 +35,4 @@ public function getStatusCode()
{
return $this->status;
}
}
}
12 changes: 5 additions & 7 deletions tests/Feature/ImageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,37 @@

namespace Makeable\CloudImages\Tests\Feature;

use Illuminate\Http\UploadedFile;
use Makeable\CloudImages\CloudImage;
use Makeable\CloudImages\FailedUploadException;
use Makeable\CloudImages\Tests\TestCase;

class ImageTest extends TestCase
{
/** @test **/
function it_defaults_to_original()
public function it_defaults_to_original()
{
$this->assertEquals($this->url('s0'), $this->image()->getUrl());
}

/** @test **/
function it_can_scale_to_max_dimension()
public function it_can_scale_to_max_dimension()
{
$this->assertEquals($this->url('s400'), $this->image()->maxDimension(400)->getUrl());
}

/** @test **/
function it_can_scale_to_dimensions()
public function it_can_scale_to_dimensions()
{
$this->assertEquals($this->url('s-w800-h600'), $this->image()->scale(800, 600)->getUrl());
}

/** @test **/
function it_can_crop_to_dimensions()
public function it_can_crop_to_dimensions()
{
$this->assertEquals($this->url('c-w800-h600'), $this->image()->crop(800, 600)->getUrl());
}

/** @test **/
function it_can_crop_from_center()
public function it_can_crop_from_center()
{
$this->assertEquals($this->url('n-w800-h600'), $this->image()->cropCenter(800, 600)->getUrl());
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Feature/UploadTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class UploadTest extends TestCase
{
/** @test **/
function it_uploads_images()
public function it_uploads_images()
{
$image = CloudImage::upload(UploadedFile::fake()->image('original-filename.jpg'), 'test.jpg');

Expand All @@ -20,7 +20,7 @@ function it_uploads_images()
}

/** @test **/
function it_hashes_filename_on_default()
public function it_hashes_filename_on_default()
{
$image = UploadedFile::fake()->image('original-filename.jpg');
$hash = $image->hashName();
Expand All @@ -30,7 +30,7 @@ function it_hashes_filename_on_default()
}

/** @test **/
function it_throws_exception_on_failed_upload()
public function it_throws_exception_on_failed_upload()
{
$this->failHttpRequest();

Expand Down
2 changes: 0 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ public function createApplication()
return $app;
}

/**
*/
public function fakeServices()
{
Storage::fake('gcs');
Expand Down

0 comments on commit d7dfa90

Please sign in to comment.