@@ -146,10 +146,25 @@ public function testSpaceBeforeBraces() {
146146@media screen{.main{background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}} ' , $ this ->oDocument ->render (OutputFormat::create ()->setSpaceBeforeOpeningBrace ('' )));
147147 }
148148
149- // public function testIgnoreExceptions() {
150- // $this->assertSame('.main, .test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
151- // @media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}
152- // }', $this->oDocument->render(OutputFormat::create()->setIgnoreExceptions('')));
153- // }
149+ /**
150+ * @expectedException Sabberworm\CSS\Parsing\OutputException
151+ */
152+ public function testIgnoreExceptionsOff () {
153+ $ aBlocks = $ this ->oDocument ->getAllDeclarationBlocks ();
154+ $ oFirstBlock = $ aBlocks [0 ];
155+ $ oFirstBlock ->removeSelector ('.main ' );
156+ $ this ->assertSame ('.test {font: italic normal bold 16px/1.2 "Helvetica",Verdana,sans-serif;background: white;}
157+ @media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}} ' , $ this ->oDocument ->render (OutputFormat::create ()->setIgnoreExceptions (false )));
158+ $ oFirstBlock ->removeSelector ('.test ' );
159+ $ this ->oDocument ->render (OutputFormat::create ()->setIgnoreExceptions (false ));
160+ }
161+
162+ public function testIgnoreExceptionsOn () {
163+ $ aBlocks = $ this ->oDocument ->getAllDeclarationBlocks ();
164+ $ oFirstBlock = $ aBlocks [0 ];
165+ $ oFirstBlock ->removeSelector ('.main ' );
166+ $ oFirstBlock ->removeSelector ('.test ' );
167+ $ this ->assertSame ('@media screen {.main {background-size: 100% 100%;font-size: 1.3em;background-color: #fff;}} ' , $ this ->oDocument ->render (OutputFormat::create ()->setIgnoreExceptions (true )));
168+ }
154169
155170}
0 commit comments