Skip to content

Commit

Permalink
Change the test to a media query with a comparison operator
Browse files Browse the repository at this point in the history
  • Loading branch information
mtdkei committed May 22, 2024
1 parent e2f6e27 commit bff9028
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions tests/test-css-customize.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@ class CssCustomizeTest extends WP_UnitTestCase {
public function test_css_customize_get_the_css_min() {
$tests = array(
array(
'option' => '@media (width > 1000px) { p { color: red; }}',
'correct' => '@media (width > 1000px) { p { color: red; }}',
'option' => '@media (width > 1000px) {p { color: red ;}}',
'correct' => '@media (width > 1000px) {p { color: red;}}',
),
array(
'option' => '@media (width > 1000px) {
p { color: red;
p {
color: red;
}
}',
'correct' => '@media (width > 1000px) { p { color: red; }}',
'correct' => '@media (width > 1000px) {p { color: red;}}',
),
array(
'option' => '<script></script>@media (width > 1000px) { p { color: red; }}',
'correct' => '@media (width > 1000px) { p { color: red; }}',
'option' => '<script></script>@media (width > 1000px) {p { color: red;}}',
'correct' => '@media (width > 1000px) {p { color: red;}}',
),
);

Expand Down Expand Up @@ -58,21 +59,22 @@ public function test_veu_get_the_custom_css_single() {
$test_array = array(
array(
'post_title' => 'タイトル',
'post_meta' => '@media (width > 1000px) { p { color: red; }}',
'correct' => '@media (width > 1000px) { p { color: red; }}',
'post_meta' => '@media (width > 1000px) {p { color: red ;}}',
'correct' => '@media (width > 1000px) {p { color: red;}}',
),
array(
'post_title' => 'タイトル',
'post_meta' => '@media (width > 1000px) {
p { color: red;
p {
color: red;
}
}',
'correct' => '@media (width > 1000px) { p { color: red; }}',
'correct' => '@media (width > 1000px) {p { color: red;}}',
),
array(
'post_title' => 'タイトル',
'post_meta' => '<script></script>@media (width > 1000px) { p { color: red; }}',
'correct' => '@media (width > 1000px) { p { color: red; }}',
'post_meta' => '<script></script>@media (width > 1000px) {p { color: red;}}',
'correct' => '@media (width > 1000px) {p { color: red;}}',
),
);

Expand Down

0 comments on commit bff9028

Please sign in to comment.