Skip to content

Commit

Permalink
Namespace for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sdebacker committed May 15, 2022
1 parent abda88b commit 8f00f43
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 9 deletions.
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
"Bkwld\\Croppa\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Bkwld\\Croppa\\Test\\": "tests"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
Expand All @@ -41,7 +46,7 @@
"Bkwld\\Croppa\\CroppaServiceProvider"
],
"aliases": {
"Croppa": "Bkwld\\Croppa\\Facade"
"Croppa": "Bkwld\\Croppa\\Facades\\Croppa"
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions tests/TestDelete.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<?php

namespace Bkwld\Croppa\Test;

use Bkwld\Croppa\Helpers;
use Bkwld\Croppa\Storage;
use Bkwld\Croppa\URL;
use Illuminate\Filesystem\FilesystemAdapter;
use League\Flysystem\DirectoryListing;
use Mockery;
use PHPUnit\Framework\TestCase;

/**
Expand Down
3 changes: 3 additions & 0 deletions tests/TestListAllCrops.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?php

namespace Bkwld\Croppa\Test;

use Bkwld\Croppa\Storage;
use Illuminate\Filesystem\FilesystemAdapter;
use League\Flysystem\DirectoryListing;
use Mockery;
use PHPUnit\Framework\TestCase;

/**
Expand Down
2 changes: 2 additions & 0 deletions tests/TestResizing.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Bkwld\Croppa\Test;

use Bkwld\Croppa\Image;
use PHPUnit\Framework\TestCase;

Expand Down
3 changes: 3 additions & 0 deletions tests/TestTooManyCrops.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?php

namespace Bkwld\Croppa\Test;

use Bkwld\Croppa\Storage;
use Illuminate\Filesystem\FilesystemAdapter;
use League\Flysystem\DirectoryListing;
use Mockery;
use PHPUnit\Framework\TestCase;

/**
Expand Down
2 changes: 2 additions & 0 deletions tests/TestUrlGenerator.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Bkwld\Croppa\Test;

use Bkwld\Croppa\URL;
use PHPUnit\Framework\TestCase;

Expand Down
2 changes: 2 additions & 0 deletions tests/TestUrlMatching.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Bkwld\Croppa\Test;

use Bkwld\Croppa\URL;
use PHPUnit\Framework\TestCase;

Expand Down
24 changes: 16 additions & 8 deletions tests/TestUrlParsing.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<?php

namespace Bkwld\Croppa\Test;

use Bkwld\Croppa\Filters\BlackWhite;
use Bkwld\Croppa\Filters\Blur;
use Bkwld\Croppa\Filters\Darkgray;
use Bkwld\Croppa\Filters\Negative;
use Bkwld\Croppa\Filters\OrangeWarhol;
use Bkwld\Croppa\Filters\TurquoiseWarhol;
use Bkwld\Croppa\URL;
use PHPUnit\Framework\TestCase;

Expand All @@ -16,12 +24,12 @@ public function setUp(): void
$this->url = new URL([
'path' => 'uploads/(.*)$',
'filters' => [
'gray' => Bkwld\Croppa\Filters\BlackWhite::class,
'darkgray' => Bkwld\Croppa\Filters\Darkgray::class,
'blur' => Bkwld\Croppa\Filters\Blur::class,
'negative' => Bkwld\Croppa\Filters\Negative::class,
'orange' => Bkwld\Croppa\Filters\OrangeWarhol::class,
'turquoise' => Bkwld\Croppa\Filters\TurquoiseWarhol::class,
'gray' => BlackWhite::class,
'darkgray' => Darkgray::class,
'blur' => Blur::class,
'negative' => Negative::class,
'orange' => OrangeWarhol::class,
'turquoise' => TurquoiseWarhol::class,
],
]);
}
Expand Down Expand Up @@ -77,8 +85,8 @@ public function testFilters()
{
$this->assertEquals([
'1/2/file.jpg', 200, 100, ['filters' => [
new Bkwld\Croppa\Filters\Blur(),
new Bkwld\Croppa\Filters\Negative(),
new Blur(),
new Negative(),
]],
], $this->url->parse('uploads/1/2/file-200x100-filters(blur,negative).jpg'));
}
Expand Down

0 comments on commit 8f00f43

Please sign in to comment.