public function testPreload() { $this->
assertEquals('/foo.css',
$this->extension->
preload('/foo.css',
['as' => 'style', 'crossorigin' => true
]));
$link =
(new Link('preload', '/foo.css'
))->
withAttribute('as', 'style'
)->
withAttribute('crossorigin', true
);
$this->
assertEquals([$link],
array_values($this->request->attributes->
get('_links'
)->
getLinks()));
} public function testDnsPrefetch() { $this->
assertEquals('/foo.css',
$this->extension->
dnsPrefetch('/foo.css',
['as' => 'style', 'crossorigin' => true
]));
$link =
(new Link('dns-prefetch', '/foo.css'
))->
withAttribute('as', 'style'
)->
withAttribute('crossorigin', true
);
$this->
assertEquals([$link],
array_values($this->request->attributes->
get('_links'
)->
getLinks()));
} public function testPreconnect() { $this->
assertEquals('/foo.css',
$this->extension->
preconnect('/foo.css',
['as' => 'style', 'crossorigin' => true
]));
$link =
(new Link('preconnect', '/foo.css'
))->
withAttribute('as', 'style'
)->
withAttribute('crossorigin', true
);
$this->
assertEquals([$link],
array_values($this->request->attributes->
get('_links'
)->
getLinks()));
}