|
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'; |
@@ -223,23 +223,23 @@ function testManipulation() { |
223 | 223 | $this->assertSame('#header {margin: 10px 2em 1cm 2%;color: red !important;frequency: 30Hz;} |
224 | 224 | body {color: green;}', $oDoc->render()); |
225 | 225 | } |
226 | | - |
| 226 | + |
227 | 227 | function testRuleGetters() { |
228 | 228 | $oDoc = $this->parsedStructureForFile('values'); |
229 | 229 | $aBlocks = $oDoc->getAllDeclarationBlocks(); |
230 | 230 | $oHeaderBlock = $aBlocks[0]; |
231 | 231 | $oBodyBlock = $aBlocks[1]; |
232 | 232 | $aHeaderRules = $oHeaderBlock->getRules('background-'); |
233 | | - $this->assertSame(2, count($aHeaderRules)); |
| 233 | + $this->assertCount(2, $aHeaderRules); |
234 | 234 | $this->assertSame('background-color', $aHeaderRules[0]->getRule()); |
235 | 235 | $this->assertSame('background-color', $aHeaderRules[1]->getRule()); |
236 | 236 | $aHeaderRules = $oHeaderBlock->getRulesAssoc('background-'); |
237 | | - $this->assertSame(1, count($aHeaderRules)); |
238 | | - $this->assertSame(true, $aHeaderRules['background-color']->getValue() instanceof \Sabberworm\CSS\Value\Color); |
| 237 | + $this->assertCount(1, $aHeaderRules); |
| 238 | + $this->assertTrue($aHeaderRules['background-color']->getValue() instanceof \Sabberworm\CSS\Value\Color); |
239 | 239 | $this->assertSame('rgba', $aHeaderRules['background-color']->getValue()->getColorDescription()); |
240 | 240 | $oHeaderBlock->removeRule($aHeaderRules['background-color']); |
241 | 241 | $aHeaderRules = $oHeaderBlock->getRules('background-'); |
242 | | - $this->assertSame(1, count($aHeaderRules)); |
| 242 | + $this->assertCount(1, $aHeaderRules); |
243 | 243 | $this->assertSame('green', $aHeaderRules[0]->getValue()); |
244 | 244 | } |
245 | 245 |
|
@@ -328,7 +328,7 @@ function testNamespaces() { |
328 | 328 | |test {gaga: 2;}'; |
329 | 329 | $this->assertSame($sExpected, $oDoc->render()); |
330 | 330 | } |
331 | | - |
| 331 | + |
332 | 332 | function testInnerColors() { |
333 | 333 | $oDoc = $this->parsedStructureForFile('inner-color'); |
334 | 334 | $sExpected = 'test {background: -webkit-gradient(linear,0 0,0 bottom,from(#006cad),to(hsl(202,100%,49%)));}'; |
@@ -368,21 +368,21 @@ function testListValueRemoval() { |
368 | 368 | $this->assertSame('@media screen {html {some: -test(val2);}} |
369 | 369 | #unrelated {other: yes;}', $oDoc->render()); |
370 | 370 | } |
371 | | - |
| 371 | + |
372 | 372 | /** |
373 | 373 | * @expectedException Sabberworm\CSS\Parsing\OutputException |
374 | 374 | */ |
375 | 375 | function testSelectorRemoval() { |
376 | 376 | $oDoc = $this->parsedStructureForFile('1readme'); |
377 | 377 | $aBlocks = $oDoc->getAllDeclarationBlocks(); |
378 | 378 | $oBlock1 = $aBlocks[0]; |
379 | | - $this->assertSame(true, $oBlock1->removeSelector('html')); |
| 379 | + $this->assertTrue($oBlock1->removeSelector('html')); |
380 | 380 | $sExpected = '@charset "utf-8"; |
381 | 381 | @font-face {font-family: "CrassRoots";src: url("../media/cr.ttf");} |
382 | 382 | body {font-size: 1.6em;}'; |
383 | 383 | $this->assertSame($sExpected, $oDoc->render()); |
384 | | - $this->assertSame(false, $oBlock1->removeSelector('html')); |
385 | | - $this->assertSame(true, $oBlock1->removeSelector('body')); |
| 384 | + $this->assertFalse($oBlock1->removeSelector('html')); |
| 385 | + $this->assertTrue($oBlock1->removeSelector('body')); |
386 | 386 | // This tries to output a declaration block without a selector and throws. |
387 | 387 | $oDoc->render(); |
388 | 388 | } |
|
0 commit comments