Skip to content

Commit 9192d95

Browse files
authored
[TASK] Add the first basic functional tests for Parser (#1020)
Part of #757
1 parent 571b91b commit 9192d95

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

tests/Functional/ParserTest.php

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Sabberworm\CSS\Tests\Functional;
6+
7+
use PHPUnit\Framework\TestCase;
8+
use Sabberworm\CSS\CSSList\Document;
9+
use Sabberworm\CSS\Parser;
10+
11+
/**
12+
* @covers \Sabberworm\CSS\Parser
13+
*/
14+
final class ParserTest extends TestCase
15+
{
16+
/**
17+
* @test
18+
*/
19+
public function parseWithEmptyStringReturnsDocument(): void
20+
{
21+
$parser = new Parser('');
22+
23+
$result = $parser->parse();
24+
25+
self::assertInstanceOf(Document::class, $result);
26+
}
27+
28+
/**
29+
* @test
30+
*/
31+
public function parseWithOneRuleSetReturnsDocument(): void
32+
{
33+
$parser = new Parser('.thing { }');
34+
35+
$result = $parser->parse();
36+
37+
self::assertInstanceOf(Document::class, $result);
38+
}
39+
}

0 commit comments

Comments
 (0)