Skip to content

Commit 68a2299

Browse files
authored
Add support for yiisoft/html version ^4.0 (#305)
1 parent b507fc0 commit 68a2299

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## 12.2.4 under development
44

5-
- no changes in this release.
5+
- Enh #305: Add support for `yiisoft/html` version `^4.0` (@vjik)
66

77
## 12.2.3 January 26, 2026
88

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"yiisoft/arrays": "^2.0 || ^3.0",
3232
"yiisoft/cache": "^1.0 || ^2.0 || ^3.0",
3333
"yiisoft/files": "^1.0 || ^2.0",
34-
"yiisoft/html": "^2.5 || ^3.0",
34+
"yiisoft/html": "^2.5 || ^3.0 || ^4.0",
3535
"yiisoft/json": "^1.0"
3636
},
3737
"require-dev": {

tests/WebViewTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public function testRegisterCssFile(string $url): void
206206
$webView->registerCssFile($url);
207207

208208
$html = $webView->render('positions.php');
209-
$this->assertStringContainsString('[HEAD]<link href="' . $url . '" rel="stylesheet">[/HEAD]', $html);
209+
$this->assertStringContainsString('[HEAD]<link rel="stylesheet" href="' . $url . '">[/HEAD]', $html);
210210
}
211211

212212
public function testRegisterCssFileEdgeCase(): void
@@ -220,9 +220,9 @@ public function testRegisterCssFileEdgeCase(): void
220220

221221
$this->assertStringContainsString(
222222
<<<HTML
223-
[HEAD]<link href="main.css" rel="stylesheet">
224-
<link href="main.css" rel="stylesheet" data-x="1">
225-
<link href="main.css" rel="stylesheet" data-x="2">[/HEAD]
223+
[HEAD]<link rel="stylesheet" href="main.css">
224+
<link rel="stylesheet" href="main.css" data-x="1">
225+
<link rel="stylesheet" href="main.css" data-x="2">[/HEAD]
226226
HTML,
227227
$html,
228228
);
@@ -241,15 +241,15 @@ public static function dataRegisterCssFileWithPosition(): array
241241
{
242242
return [
243243
[
244-
'[HEAD]<link href="/somefile.css" rel="stylesheet">[/HEAD]',
244+
'[HEAD]<link rel="stylesheet" href="/somefile.css">[/HEAD]',
245245
WebView::POSITION_HEAD,
246246
],
247247
[
248-
'[BEGINBODY]<link href="/somefile.css" rel="stylesheet">[/BEGINBODY]',
248+
'[BEGINBODY]<link rel="stylesheet" href="/somefile.css">[/BEGINBODY]',
249249
WebView::POSITION_BEGIN,
250250
],
251251
[
252-
'[ENDBODY]<link href="/somefile.css" rel="stylesheet">[/ENDBODY]',
252+
'[ENDBODY]<link rel="stylesheet" href="/somefile.css">[/ENDBODY]',
253253
WebView::POSITION_END,
254254
],
255255
];
@@ -732,8 +732,8 @@ public function testAddCssFiles(): void
732732
$html = $webView->render('positions.php');
733733

734734
$expected = '[BEGINPAGE][/BEGINPAGE]' . "\n"
735-
. '[HEAD]<link href="file-1.css" rel="stylesheet">[/HEAD]' . "\n"
736-
. '[BEGINBODY]<link href="file-2.css" rel="stylesheet" crossorigin="anonymous">[/BEGINBODY]' . "\n"
735+
. '[HEAD]<link rel="stylesheet" href="file-1.css">[/HEAD]' . "\n"
736+
. '[BEGINBODY]<link rel="stylesheet" href="file-2.css" crossorigin="anonymous">[/BEGINBODY]' . "\n"
737737
. '[ENDBODY][/ENDBODY]' . "\n"
738738
. '[ENDPAGE][/ENDPAGE]';
739739

0 commit comments

Comments
 (0)