mirror of
https://github.com/archtechx/laravel-seo.git
synced 2025-12-12 18:04:03 +00:00
Fix flipp alias logic
This commit is contained in:
parent
8b6e049830
commit
56fc6f4b49
2 changed files with 10 additions and 2 deletions
|
|
@ -153,6 +153,8 @@ class SEOManager
|
||||||
|
|
||||||
$signature = hash_hmac('sha256', $template . $query, config('services.flipp.key'));
|
$signature = hash_hmac('sha256', $template . $query, config('services.flipp.key'));
|
||||||
|
|
||||||
|
$template = $this->meta("flipp.templates.$template");
|
||||||
|
|
||||||
return $this->set('image', "https://s.useflipp.com/{$template}.png?s={$signature}&v={$query}");
|
return $this->set('image', "https://s.useflipp.com/{$template}.png?s={$signature}&v={$query}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,16 @@ test('flipp templates can be set', function () {
|
||||||
->toHaveKey('blog', 'abcdefg');
|
->toHaveKey('blog', 'abcdefg');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('flipp makes a request to the template not the alias', function () {
|
||||||
|
seo()->flipp('blog', 'abcdefg');
|
||||||
|
expect(seo()->flipp('blog'))
|
||||||
|
->toContain('s.useflipp.com/abcdefg');
|
||||||
|
});
|
||||||
|
|
||||||
test('flipp templates can be given data', function () {
|
test('flipp templates can be given data', function () {
|
||||||
seo()->flipp('blog', 'abcdefg');
|
seo()->flipp('blog', 'abcdefg');
|
||||||
expect(seo()->flipp('blog', ['title' => 'abc', 'excerpt' => 'def']))
|
expect(seo()->flipp('blog', ['title' => 'abc', 'excerpt' => 'def']))
|
||||||
->toContain('s.useflipp.com/blog')
|
->toContain('s.useflipp.com/abcdefg')
|
||||||
->toContain(base64_encode(json_encode(['title' => 'abc', 'excerpt' => 'def'])));
|
->toContain(base64_encode(json_encode(['title' => 'abc', 'excerpt' => 'def'])));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -30,7 +36,7 @@ test("flipp templates use default data when they're not passed any data explicit
|
||||||
seo()->title('foo')->description('bar');
|
seo()->title('foo')->description('bar');
|
||||||
|
|
||||||
expect(seo()->flipp('blog'))
|
expect(seo()->flipp('blog'))
|
||||||
->toContain('s.useflipp.com/blog')
|
->toContain('s.useflipp.com/abcdefg')
|
||||||
->toContain(base64_encode(json_encode(['title' => 'foo', 'description' => 'bar'])));
|
->toContain(base64_encode(json_encode(['title' => 'foo', 'description' => 'bar'])));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue