mirror of
https://github.com/archtechx/laravel-seo.git
synced 2025-12-12 18:04:03 +00:00
wip
This commit is contained in:
parent
5ca343a116
commit
03c7fa5eee
5 changed files with 98 additions and 35 deletions
|
|
@ -1,14 +1,27 @@
|
|||
<?php
|
||||
|
||||
use ArchTech\SEO\Commands\GenerateFaviconsCommand;
|
||||
|
||||
use function Pest\Laravel\artisan;
|
||||
use function PHPUnit\Framework\assertFileExists;
|
||||
|
||||
test("it should throw an exception if the given source icon doesn't exist", function () {
|
||||
seo()->favicon('i-dont-exist.png');
|
||||
})->throws(Exception::class, 'Given icon path `i-dont-exist.png` does not exist.');
|
||||
|
||||
test('it should generate two favicons', function () {
|
||||
seo()->favicon(__DIR__ . '/../stubs/logo.png');
|
||||
seo()->favicon();
|
||||
|
||||
$from = __DIR__ . '/../stubs/logo.png';
|
||||
|
||||
artisan(GenerateFaviconsCommand::class, [
|
||||
'from' => $from,
|
||||
])->assertSuccessful();
|
||||
|
||||
assertFileExists(public_path('favicon.ico'));
|
||||
assertFileExists(public_path('favicon.png'));
|
||||
});
|
||||
|
||||
test('it should fail because the from path is incorrect', function () {
|
||||
seo()->favicon();
|
||||
|
||||
artisan(GenerateFaviconsCommand::class, [
|
||||
'from' => 'i/dont/exist.png',
|
||||
])->assertFailed();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue