mirror of
https://github.com/archtechx/laravel-seo.git
synced 2025-12-12 18:04:03 +00:00
Make flipp use raw values
This commit is contained in:
parent
9cebfec4c8
commit
ab1e01b066
3 changed files with 33 additions and 3 deletions
|
|
@ -27,7 +27,7 @@ test('the flipp method returns a link to a signed url', function () {
|
|||
seo()->flipp('blog', 'abcdefg');
|
||||
|
||||
expect(seo()->flipp('blog', ['title' => 'abc']))
|
||||
->toContain('?s=' . hash_hmac('sha256', 'blog' . base64_encode(json_encode(['title' => 'abc'])), config('services.flipp.key')));
|
||||
->toContain('?s=' . hash_hmac('sha256', 'abcdefg' . base64_encode(json_encode(['title' => 'abc'])), config('services.flipp.key')));
|
||||
});
|
||||
|
||||
test("flipp templates use default data when they're not passed any data explicitly", function () {
|
||||
|
|
@ -57,3 +57,14 @@ test('the blade directive can be used with flipp', function () {
|
|||
expect(blade("@seo('flipp', 'blog')"))->toBe(seo()->flipp('blog'));
|
||||
expect(blade("@seo('flipp', 'blog', ['title' => 'abc'])"))->toBe(seo()->flipp('blog', ['title' => 'abc']));
|
||||
});
|
||||
|
||||
test('flipp uses the raw title and description', function () {
|
||||
seo()->flipp('blog', 'abcdefg');
|
||||
|
||||
seo()->title(modify: fn (string $title) => $title . ' - modified');
|
||||
seo()->title('foo')->description('bar');
|
||||
|
||||
expect(seo()->flipp('blog'))
|
||||
->toContain('s.useflipp.com/abcdefg')
|
||||
->toContain(base64_encode(json_encode(['title' => 'foo', 'description' => 'bar'])));
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue