Skip to content

Commit

Permalink
tests: improved.
Browse files Browse the repository at this point in the history
  • Loading branch information
iamriajul committed Oct 31, 2023
1 parent 359683a commit 4faa4dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 3 additions & 2 deletions tests/LaravelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Riajul\Thumbhash\Facades\Thumbhash;
use Illuminate\Foundation\Application;
use Orchestra\Testbench\TestCase;
use Riajul\Thumbhash\ThumbhashServiceProvider;

class LaravelTest extends TestCase
{
Expand All @@ -16,7 +17,7 @@ class LaravelTest extends TestCase
*/
protected function getPackageProviders($app): array
{
return ['Riajul\Thumbhash\ThumbhashServiceProvider'];
return [ThumbhashServiceProvider::class];
}

/**
Expand All @@ -28,7 +29,7 @@ protected function getPackageProviders($app): array
protected function getPackageAliases($app): array
{
return [
'Thumbhash' => 'Thumbhash\Thumbhash\Facades\Thumbhash',
'Thumbhash' => Thumbhash::class,
];
}

Expand Down
11 changes: 8 additions & 3 deletions tests/ThumbhashTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ public function testEncode(): void
],
[
'url' => 'assets/field.jpg',
'hash' => '3OcRJYB4d3h/iIeHeEh3eIhw+j3A'
'hash' => '3OcRJYB4d3h/iIeHeEh3eIhw6j7A'
],
[
'url' => 'assets/fall.jpg',
'hash' => 'HBkSHYSIeHiPiHh8eJd4eTN0EEQG'
],
[
'url' => 'assets/street.jpg',
'hash' => 'VggKDYAW6lZvdYd6d2iZh/p4GE/k'
'hash' => 'VggKDYAW6lZvdYd6d2iZh/p4CE/j'
],
[
'url' => 'assets/mountain.jpg',
'hash' => '2fcZFIB3iId/h3iJh4aIYJ2V8g'
'hash' => '2fcZFIB3iId/h3iJh4aJUJ2V8g'
],
[
'url' => 'assets/coast.jpg',
Expand All @@ -56,6 +56,11 @@ public function testEncode(): void

$hash = new Thumbhash();

$this->assertSame(
'imagick',
$hash->getDriver(),
);

foreach ($data as $item) {
$this->assertSame(
$item['hash'],
Expand Down

0 comments on commit 4faa4dd

Please sign in to comment.