1
0
Fork 0
mirror of https://github.com/archtechx/laravel-seo.git synced 2025-12-12 01:44:03 +00:00
This commit is contained in:
Ben Bjurstrom 2024-09-04 09:54:37 -07:00
parent 7ff2ff9883
commit cbb33fa269

View file

@ -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();