mirror of
https://github.com/archtechx/laravel-seo.git
synced 2025-12-12 01:44:03 +00:00
Add test
This commit is contained in:
parent
7ff2ff9883
commit
cbb33fa269
1 changed files with 12 additions and 0 deletions
|
|
@ -1,6 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use ArchTech\SEO\SEOManager;
|
use ArchTech\SEO\SEOManager;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Mockery\MockInterface;
|
||||||
|
|
||||||
test('set returns the set value', function () {
|
test('set returns the set value', function () {
|
||||||
expect(seo()->set('foo', 'bar'))->toBe('bar');
|
expect(seo()->set('foo', 'bar'))->toBe('bar');
|
||||||
|
|
@ -118,6 +120,16 @@ test('canonical url can be read from request', function () {
|
||||||
->toContain('<link rel="canonical" href="http://localhost" />');
|
->toContain('<link rel="canonical" href="http://localhost" />');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('canonical url accepts origin', function () {
|
||||||
|
$this->get('/testing/5');
|
||||||
|
|
||||||
|
seo()->withUrl('https://foo.com');
|
||||||
|
|
||||||
|
expect(meta())
|
||||||
|
->toContain('<meta property="og:url" content="https://foo.com/testing/5" />')
|
||||||
|
->toContain('<link rel="canonical" href="https://foo.com/testing/5" />');
|
||||||
|
});
|
||||||
|
|
||||||
test('canonical url can be changed', function () {
|
test('canonical url can be changed', function () {
|
||||||
seo()->withUrl();
|
seo()->withUrl();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue