mirror of
https://github.com/archtechx/laravel-seo.git
synced 2025-12-12 09:54:03 +00:00
finished
This commit is contained in:
parent
051a32575c
commit
b12c9ecb55
21 changed files with 750 additions and 86 deletions
21
tests/Pest/ModifierTest.php
Normal file
21
tests/Pest/ModifierTest.php
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
test('values can be modified using modifiers', function () {
|
||||
seo()->title(modify: fn (string $title) => $title . ' | ArchTech');
|
||||
|
||||
seo()->title('About us');
|
||||
|
||||
expect(seo('title'))->toBe('About us | ArchTech');
|
||||
});
|
||||
|
||||
test('modifiers are applied on values returned from set', function () {
|
||||
seo()->title(modify: fn (string $title) => $title . ' | ArchTech');
|
||||
|
||||
expect(seo(['title' => 'Blog']))->toHaveKey('title', 'Blog | ArchTech');
|
||||
});
|
||||
|
||||
test('modifiers are not applied on default values', function () {
|
||||
seo()->title(modify: fn (string $title) => $title . ' | ArchTech', default: 'ArchTech — Web development agency');
|
||||
|
||||
expect(seo('title'))->toBe('ArchTech — Web development agency');
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue