From b1f74798a7d21d0e6f6402ee8a06c92c7f92fae5 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Mon, 20 Dec 2021 17:32:57 -0800 Subject: [PATCH] Replace invalid turns unit with turn --- src/Value/Size.php | 2 +- tests/ParserTest.php | 6 +++--- tests/fixtures/values.css | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Value/Size.php b/src/Value/Size.php index b3801dc17..6456ba790 100644 --- a/src/Value/Size.php +++ b/src/Value/Size.php @@ -24,7 +24,7 @@ class Size extends PrimitiveValue /** * @var array */ - const NON_SIZE_UNITS = ['deg', 'grad', 'rad', 's', 'ms', 'turns', 'Hz', 'kHz']; + const NON_SIZE_UNITS = ['deg', 'grad', 'rad', 's', 'ms', 'turn', 'Hz', 'kHz']; /** * @var array>|null diff --git a/tests/ParserTest.php b/tests/ParserTest.php index ab247c3de..40c345837 100644 --- a/tests/ParserTest.php +++ b/tests/ParserTest.php @@ -360,7 +360,7 @@ public function manipulation() self::assertSame( '#header {margin: 10px 2em 1cm 2%;font-family: Verdana,Helvetica,"Gill Sans",sans-serif;' . 'font-size: 10px;color: red !important;background-color: green;' - . 'background-color: rgba(0,128,0,.7);frequency: 30Hz;} + . 'background-color: rgba(0,128,0,.7);frequency: 30Hz;transform: rotate(1turn);} body {color: green;font: 75% "Lucida Grande","Trebuchet MS",Verdana,sans-serif;}', $oDoc->render() ); @@ -369,7 +369,7 @@ public function manipulation() } self::assertSame( '#header {margin: 10px 2em 1cm 2%;color: red !important;background-color: green;' - . 'background-color: rgba(0,128,0,.7);frequency: 30Hz;} + . 'background-color: rgba(0,128,0,.7);frequency: 30Hz;transform: rotate(1turn);} body {color: green;}', $oDoc->render() ); @@ -377,7 +377,7 @@ public function manipulation() $oRuleSet->removeRule('background-'); } self::assertSame( - '#header {margin: 10px 2em 1cm 2%;color: red !important;frequency: 30Hz;} + '#header {margin: 10px 2em 1cm 2%;color: red !important;frequency: 30Hz;transform: rotate(1turn);} body {color: green;}', $oDoc->render() ); diff --git a/tests/fixtures/values.css b/tests/fixtures/values.css index 47be69b0c..35dbd729f 100644 --- a/tests/fixtures/values.css +++ b/tests/fixtures/values.css @@ -6,6 +6,7 @@ background-color: green; background-color: rgba(0,128,0,0.7); frequency: 30Hz; + transform: rotate(1turn); } body {