mirror of
https://github.com/archtechx/laravel-seo.git
synced 2025-12-13 18:24:04 +00:00
finished
This commit is contained in:
parent
051a32575c
commit
b12c9ecb55
21 changed files with 750 additions and 86 deletions
42
tests/Pest/FlippTest.php
Normal file
42
tests/Pest/FlippTest.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
test('flipp templates can be set', function () {
|
||||
seo()->flipp('blog', 'abcdefg');
|
||||
|
||||
expect(seo()->meta('flipp.templates'))
|
||||
->toHaveCount(1)
|
||||
->toHaveKey('blog', 'abcdefg');
|
||||
});
|
||||
|
||||
test('flipp templates can be given data', function () {
|
||||
seo()->flipp('blog', 'abcdefg');
|
||||
expect(seo()->flipp('blog', ['title' => 'abc', 'excerpt' => 'def']))
|
||||
->toContain('s.useflipp.com/blog')
|
||||
->toContain(base64_encode(json_encode(['title' => 'abc', 'excerpt' => 'def'])));
|
||||
});
|
||||
|
||||
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')));
|
||||
});
|
||||
|
||||
test("flipp templates use default data when they're not passed any data explicitly", function () {
|
||||
seo()->flipp('blog', 'abcdefg');
|
||||
|
||||
seo()->title('foo')->description('bar');
|
||||
|
||||
expect(seo()->flipp('blog'))
|
||||
->toContain('s.useflipp.com/blog')
|
||||
->toContain(base64_encode(json_encode(['title' => 'foo', 'description' => 'bar'])));
|
||||
});
|
||||
|
||||
test('flipp images are used as the cover images', function () {
|
||||
seo()->flipp('blog', 'abcdefg');
|
||||
|
||||
seo()->title('foo')->description('bar');
|
||||
|
||||
expect(seo()->flipp('blog'))
|
||||
->toBe(seo('image'));
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue