@@ -214,7 +214,7 @@ function testManipulation() {
214214 $ this ->assertSame ('#header {margin: 10px 2em 1cm 2%;color: red !important;frequency: 30Hz;}
215215body {color: green;} ' , $ oDoc ->render ());
216216 }
217-
217+
218218 function testRuleGetters () {
219219 $ oDoc = $ this ->parsedStructureForFile ('values ' );
220220 $ aBlocks = $ oDoc ->getAllDeclarationBlocks ();
@@ -319,7 +319,7 @@ function testNamespaces() {
319319|test {gaga: 2;} ' ;
320320 $ this ->assertSame ($ sExpected , $ oDoc ->render ());
321321 }
322-
322+
323323 function testInnerColors () {
324324 $ oDoc = $ this ->parsedStructureForFile ('inner-color ' );
325325 $ sExpected = 'test {background: -webkit-gradient(linear,0 0,0 bottom,from(#006cad),to(hsl(202,100%,49%)));} ' ;
@@ -359,7 +359,7 @@ function testListValueRemoval() {
359359 $ this ->assertSame ('@media screen {html {some: -test(val2);}}
360360#unrelated {other: yes;} ' , $ oDoc ->render ());
361361 }
362-
362+
363363 /**
364364 * @expectedException Sabberworm\CSS\Parsing\OutputException
365365 */
@@ -766,4 +766,22 @@ function testLonelyImport() {
766766 $ sExpected = "@import url( \"example.css \") only screen and (max-width: 600px); " ;
767767 $ this ->assertSame ($ sExpected , $ oDoc ->render ());
768768 }
769+
770+ function testTurnUnitLenient () {
771+ $ sText = ".foo {transform: rotate(1turn);} \n.bar {transform: rotate(1turns);} " ;
772+ $ sExpected = ".foo {transform: rotate(1turn);} \n.bar {transform: rotate(1turn);} " ;
773+
774+ $ oParser = new Parser ($ sText );
775+ $ this ->assertSame ($ sExpected , $ oParser ->parse ()->render ());
776+ }
777+
778+ function testTurnUnitStrict () {
779+ $ sText = ".foo {transform: rotate(1turn);} \n.bar {transform: rotate(1turns);} " ;
780+
781+ $ oParser = new Parser ($ sText , Settings::create ()->beStrict ());
782+
783+ // Line 2 contains the invalid unit and so should be reported.
784+ $ this ->setExpectedException ( 'Sabberworm\CSS\Parsing\UnexpectedTokenException ' , 'Identifier expected. Got “turns” [line no: 2] ' );
785+ $ oParser ->parse ();
786+ }
769787}
0 commit comments