Skip to content

Commit bbc1bf0

Browse files
committed
Tweaks with updated PSR spec
1 parent 749ef47 commit bbc1bf0

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

UPGRADE-2.0.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ The below guide will assist in upgrading from the 1.x versions to 2.0.
99

1010
## General Changes
1111

12-
- Uses 1.1 or later of the PSR-13 specification, which requires PHP 8.0
13-
- The `$attributes` parameter of the PushManager class' methods no longer accepts mixed values, per the PSR these must be strings
12+
- Uses ^1.1.1 or ^2.0.1 of the PSR-13 specification, which requires PHP 8.0
1413
- The `PushManager::link()` method's `$rel` param now supports a string or array of strings

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"keywords": ["laravel", "server-push"],
66
"require": {
77
"php": "^8.0",
8-
"fig/link-util": "dev-master",
8+
"fig/link-util": "^1.2",
99
"illuminate/http": "^8.12",
1010
"illuminate/support": "^8.12",
1111
"psr/link": "^1.1.1 || ^2.0.1"

tests/Http/HeaderSerializerTest.php

-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ protected function setUp(): void
2020

2121
public function testSerialize()
2222
{
23-
$this->markTestSkipped('Broken on newer PSR releases');
24-
2523
$links = [
2624
new Link('prerender', '/1'),
2725
(new Link('dns-prefetch', '/2'))->withAttribute('pr', 0.7),

tests/Http/Middleware/ServerPushTest.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function testALinkHeaderIsAddedForPushedResources(): void
5757
$next = function (): Response {
5858
$this->pushManager->preload('/css/app.css', ['nopush' => false]);
5959
$this->pushManager->preload('/css/style.css', ['nopush' => true]);
60-
// $this->pushManager->link('/blog/page/2', 'next', ['hreflang' => ['fr', 'de']]);
60+
$this->pushManager->link('/blog/page/2', 'next', ['hreflang' => ['fr', 'de']]);
6161

6262
return new Response();
6363
};
@@ -69,8 +69,7 @@ public function testALinkHeaderIsAddedForPushedResources(): void
6969

7070
$this->assertTrue($response->headers->has('Link'));
7171
$this->assertSame(
72-
//'</css/app.css>; rel="preload",</css/style.css>; rel="preload"; nopush,</blog/page/2>; rel="next"; hreflang="fr"; hreflang="de"',
73-
'</css/app.css>; rel="preload",</css/style.css>; rel="preload"; nopush',
72+
'</css/app.css>; rel="preload",</css/style.css>; rel="preload"; nopush,</blog/page/2>; rel="next"; hreflang="fr"; hreflang="de"',
7473
$response->headers->get('Link')
7574
);
7675
}

0 commit comments

Comments
 (0)