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
38
tests/Pest/BladeTest.php
Normal file
38
tests/Pest/BladeTest.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
test('the @seo helper can be used for fetching values', function () {
|
||||
seo(['image' => 'foo']);
|
||||
|
||||
expect(blade('<img src="@seo(\'image\')">'))
|
||||
->toBe('<img src="foo">');
|
||||
});
|
||||
|
||||
test('the @seo helper can be used for setting & fetching values', function () {
|
||||
expect(blade('<img src="@seo(\'image\', \'bar\')">'))
|
||||
->toBe('<img src="bar">');
|
||||
});
|
||||
|
||||
test('the @seo helper can be used for setting values with no output', function () {
|
||||
expect(blade('<img src="@seo([\'image\' => \'foo\'])">'))
|
||||
->toBe('<img src="">');
|
||||
|
||||
expect(seo('image'))->toBe('foo');
|
||||
});
|
||||
|
||||
test("opengraph tags are rendered only if they're set", function () {
|
||||
seo()->title('foo');
|
||||
|
||||
expect(meta())
|
||||
->toContain('og:title')
|
||||
->not()->toContain('og:description');
|
||||
});
|
||||
|
||||
test('twitter tags are rendered only if the extension is enabled', function () {
|
||||
seo()->title('foo');
|
||||
|
||||
expect(meta())->not()->toContain('twitter');
|
||||
|
||||
seo()->twitter()->twitterTitle('bar');
|
||||
|
||||
expect(meta())->toContain('twitter');
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue