|
10 | 10 | use Sabberworm\CSS\Value\URL; |
11 | 11 | use Sabberworm\CSS\Parsing\UnexpectedTokenException; |
12 | 12 |
|
13 | | -class ParserTest extends \PHPUnit_Framework_TestCase { |
| 13 | +class ParserTest extends \PHPunit\Framework\TestCase { |
14 | 14 |
|
15 | 15 | function testFiles() { |
16 | 16 | $sDirectory = dirname(__FILE__) . '/../../files'; |
@@ -214,23 +214,23 @@ function testManipulation() { |
214 | 214 | $this->assertSame('#header {margin: 10px 2em 1cm 2%;color: red !important;frequency: 30Hz;} |
215 | 215 | body {color: green;}', $oDoc->render()); |
216 | 216 | } |
217 | | - |
| 217 | + |
218 | 218 | function testRuleGetters() { |
219 | 219 | $oDoc = $this->parsedStructureForFile('values'); |
220 | 220 | $aBlocks = $oDoc->getAllDeclarationBlocks(); |
221 | 221 | $oHeaderBlock = $aBlocks[0]; |
222 | 222 | $oBodyBlock = $aBlocks[1]; |
223 | 223 | $aHeaderRules = $oHeaderBlock->getRules('background-'); |
224 | | - $this->assertSame(2, count($aHeaderRules)); |
| 224 | + $this->assertCount(2, $aHeaderRules); |
225 | 225 | $this->assertSame('background-color', $aHeaderRules[0]->getRule()); |
226 | 226 | $this->assertSame('background-color', $aHeaderRules[1]->getRule()); |
227 | 227 | $aHeaderRules = $oHeaderBlock->getRulesAssoc('background-'); |
228 | | - $this->assertSame(1, count($aHeaderRules)); |
229 | | - $this->assertSame(true, $aHeaderRules['background-color']->getValue() instanceof \Sabberworm\CSS\Value\Color); |
| 228 | + $this->assertCount(1, $aHeaderRules); |
| 229 | + $this->assertTrue($aHeaderRules['background-color']->getValue() instanceof \Sabberworm\CSS\Value\Color); |
230 | 230 | $this->assertSame('rgba', $aHeaderRules['background-color']->getValue()->getColorDescription()); |
231 | 231 | $oHeaderBlock->removeRule($aHeaderRules['background-color']); |
232 | 232 | $aHeaderRules = $oHeaderBlock->getRules('background-'); |
233 | | - $this->assertSame(1, count($aHeaderRules)); |
| 233 | + $this->assertCount(1, $aHeaderRules); |
234 | 234 | $this->assertSame('green', $aHeaderRules[0]->getValue()); |
235 | 235 | } |
236 | 236 |
|
@@ -319,7 +319,7 @@ function testNamespaces() { |
319 | 319 | |test {gaga: 2;}'; |
320 | 320 | $this->assertSame($sExpected, $oDoc->render()); |
321 | 321 | } |
322 | | - |
| 322 | + |
323 | 323 | function testInnerColors() { |
324 | 324 | $oDoc = $this->parsedStructureForFile('inner-color'); |
325 | 325 | $sExpected = 'test {background: -webkit-gradient(linear,0 0,0 bottom,from(#006cad),to(hsl(202,100%,49%)));}'; |
@@ -359,21 +359,21 @@ function testListValueRemoval() { |
359 | 359 | $this->assertSame('@media screen {html {some: -test(val2);}} |
360 | 360 | #unrelated {other: yes;}', $oDoc->render()); |
361 | 361 | } |
362 | | - |
| 362 | + |
363 | 363 | /** |
364 | 364 | * @expectedException Sabberworm\CSS\Parsing\OutputException |
365 | 365 | */ |
366 | 366 | function testSelectorRemoval() { |
367 | 367 | $oDoc = $this->parsedStructureForFile('1readme'); |
368 | 368 | $aBlocks = $oDoc->getAllDeclarationBlocks(); |
369 | 369 | $oBlock1 = $aBlocks[0]; |
370 | | - $this->assertSame(true, $oBlock1->removeSelector('html')); |
| 370 | + $this->assertTrue($oBlock1->removeSelector('html')); |
371 | 371 | $sExpected = '@charset "utf-8"; |
372 | 372 | @font-face {font-family: "CrassRoots";src: url("../media/cr.ttf");} |
373 | 373 | body {font-size: 1.6em;}'; |
374 | 374 | $this->assertSame($sExpected, $oDoc->render()); |
375 | | - $this->assertSame(false, $oBlock1->removeSelector('html')); |
376 | | - $this->assertSame(true, $oBlock1->removeSelector('body')); |
| 375 | + $this->assertFalse($oBlock1->removeSelector('html')); |
| 376 | + $this->assertTrue($oBlock1->removeSelector('body')); |
377 | 377 | // This tries to output a declaration block without a selector and throws. |
378 | 378 | $oDoc->render(); |
379 | 379 | } |
|
0 commit comments