1
0
Fork 0
mirror of https://github.com/archtechx/laravel-seo.git synced 2025-12-12 09:54:03 +00:00
laravel-seo/tests/Pest/ModifierTest.php
Samuel Štancl b12c9ecb55 finished
2021-05-24 10:53:00 +02:00

21 lines
721 B
PHP

<?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');
});