Skip to content

Commit 73d8bf1

Browse files
authored
Merge pull request #243 from oliverklee/cleanup/side-effects
Change a global constant to a class constant in the tests
2 parents b7de0d7 + 235eca9 commit 73d8bf1

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

tests/Sabberworm/CSS/OutputFormatTest.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
namespace Sabberworm\CSS;
44

5-
global $TEST_CSS;
6-
7-
$TEST_CSS = <<<EOT
5+
class OutputFormatTest extends \PHPUnit\Framework\TestCase
6+
{
7+
/**
8+
* @var string
9+
*/
10+
const TEST_CSS = <<<EOT
811
912
.main, .test {
1013
font: italic normal bold 16px/1.2 "Helvetica", Verdana, sans-serif;
@@ -21,15 +24,12 @@
2124
2225
EOT;
2326

24-
class OutputFormatTest extends \PHPUnit\Framework\TestCase
25-
{
2627
private $oParser;
2728
private $oDocument;
2829

2930
protected function setUp()
3031
{
31-
global $TEST_CSS;
32-
$this->oParser = new Parser($TEST_CSS);
32+
$this->oParser = new Parser(self::TEST_CSS);
3333
$this->oDocument = $this->oParser->parse();
3434
}
3535

@@ -52,8 +52,7 @@ public function testCompact()
5252

5353
public function testPretty()
5454
{
55-
global $TEST_CSS;
56-
$this->assertSame($TEST_CSS, $this->oDocument->render(OutputFormat::createPretty()));
55+
$this->assertSame(self::TEST_CSS, $this->oDocument->render(OutputFormat::createPretty()));
5756
}
5857

5958
public function testSpaceAfterListArgumentSeparator()

0 commit comments

Comments
 (0)