Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 076462d

Browse filesBrowse files
committed
Add tests to CssAssetUrlCompiler
1 parent 02db9c2 commit 076462d
Copy full SHA for 076462d

File tree

Expand file treeCollapse file tree

1 file changed

+30
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+30
-0
lines changed

‎src/Symfony/Component/AssetMapper/Tests/Compiler/CssAssetUrlCompilerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/AssetMapper/Tests/Compiler/CssAssetUrlCompilerTest.php
+30Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,36 @@ public static function provideCompileTests(): iterable
114114
'expectedOutput' => 'body { background: url("https://cdn.io/images/bar.png"); }',
115115
'expectedDependencies' => [],
116116
];
117+
118+
yield 'ignore_comments' => [
119+
'input' => 'body { background: url("images/foo.png"); /* background: url("images/bar.png"); */ }',
120+
'expectedOutput' => 'body { background: url("images/foo.123456.png"); /* background: url("images/bar.png"); */ }',
121+
'expectedDependencies' => ['images/foo.png'],
122+
];
123+
124+
yield 'ignore_comment_after_rule' => [
125+
'input' => 'body { background: url("images/foo.png"); } /* url("images/need-ignore.png") */',
126+
'expectedOutput' => 'body { background: url("images/foo.123456.png"); } /* url("images/need-ignore.png") */',
127+
'expectedDependencies' => ['images/foo.png'],
128+
];
129+
130+
yield 'ignore_comment_within_rule' => [
131+
'input' => 'body { background: url("images/foo.png") /* url("images/need-ignore.png") */; }',
132+
'expectedOutput' => 'body { background: url("images/foo.123456.png") /* url("images/need-ignore.png") */; }',
133+
'expectedDependencies' => ['images/foo.png'],
134+
];
135+
136+
yield 'ignore_multiline_comment_after_rule' => [
137+
'input' => 'body {
138+
background: url("images/foo.png"); /*
139+
url("images/need-ignore.png") */
140+
}',
141+
'expectedOutput' => 'body {
142+
background: url("images/foo.123456.png"); /*
143+
url("images/need-ignore.png") */
144+
}',
145+
'expectedDependencies' => ['images/foo.png'],
146+
];
117147
}
118148

119149
public function testCompileFindsRelativeFilesViaSourcePath()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.