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()));
} public function testPrefetch() { $this->
assertEquals('/foo.css',
$this->extension->
prefetch('/foo.css',
['as' => 'style', 'crossorigin' => true
]));
$link =
(new Link('prefetch', '/foo.css'
))->
withAttribute('as', 'style'
)->
withAttribute('crossorigin', true
);
$this->
assertEquals([$link],
array_values($this->request->attributes->
get('_links'
)->
getLinks()));
} public function testPrerender() { $this->
assertEquals('/foo.css',
$this->extension->
prerender('/foo.css',
['as' => 'style', 'crossorigin' => true
]));
$link =
(new Link('prerender', '/foo.css'
))->
withAttribute('as', 'style'
)->
withAttribute('crossorigin', true
);
$this->
assertEquals([$link],
array_values($this->request->attributes->
get('_links'
)->
getLinks()));
}