-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from pboivin/glide-version
fix: Update glide version constraints
- Loading branch information
Showing
7 changed files
with
69 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
*.swp | ||
|
||
/__tmp__ | ||
/tests/fixtures/__cache__ | ||
/vendor | ||
/composer.lock | ||
/.php_cs.cache | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
namespace Pboivin\Flou\Tests; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Pboivin\Flou\ImageFactory; | ||
|
||
class GlideTest extends TestCase | ||
{ | ||
protected $factory; | ||
protected $sourcePath; | ||
protected $cachePath; | ||
protected $cachedFile; | ||
|
||
protected function setUp(): void | ||
{ | ||
$this->sourcePath = __DIR__ . '/fixtures/source'; | ||
|
||
$this->cachePath = __DIR__ . '/fixtures/__cache__'; | ||
|
||
$this->factory = new ImageFactory([ | ||
'sourcePath' => $this->sourcePath, | ||
'cachePath' => $this->cachePath, | ||
'sourceUrlBase' => '/images/source', | ||
'cacheUrlBase' => '/images/cache', | ||
]); | ||
|
||
$this->cleanCacheDirectories(); | ||
} | ||
|
||
protected function cleanCacheDirectories() | ||
{ | ||
if (file_exists($this->cachePath . '/square.jpg')) { | ||
foreach (glob($this->cachePath . '/square.jpg/*') as $file) { | ||
unlink($file); | ||
} | ||
|
||
rmdir($this->cachePath . '/square.jpg'); | ||
} | ||
} | ||
|
||
public function test_can_transform_source_image() | ||
{ | ||
$this->assertFalse(file_exists($this->cachePath . '/square.jpg')); | ||
|
||
$image = $this->factory->image('square.jpg'); | ||
|
||
$this->assertTrue(file_exists($this->cachePath . '/square.jpg')); | ||
$this->assertTrue(file_exists($image->cached()->path())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes