Skip to content

Change a global constant to a class constant in the tests #243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions tests/Sabberworm/CSS/OutputFormatTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

namespace Sabberworm\CSS;

global $TEST_CSS;

$TEST_CSS = <<<EOT
class OutputFormatTest extends \PHPUnit\Framework\TestCase
{
/**
* @var string
*/
const TEST_CSS = <<<EOT

.main, .test {
font: italic normal bold 16px/1.2 "Helvetica", Verdana, sans-serif;
Expand All @@ -21,15 +24,12 @@

EOT;

class OutputFormatTest extends \PHPUnit\Framework\TestCase
{
private $oParser;
private $oDocument;

protected function setUp()
{
global $TEST_CSS;
$this->oParser = new Parser($TEST_CSS);
$this->oParser = new Parser(self::TEST_CSS);
$this->oDocument = $this->oParser->parse();
}

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

public function testPretty()
{
global $TEST_CSS;
$this->assertSame($TEST_CSS, $this->oDocument->render(OutputFormat::createPretty()));
$this->assertSame(self::TEST_CSS, $this->oDocument->render(OutputFormat::createPretty()));
}

public function testSpaceAfterListArgumentSeparator()
Expand Down