Skip to content
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
68 changes: 68 additions & 0 deletions tests/Unit/CSSList/AtRuleBlockListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

/**
* @covers \Sabberworm\CSS\CSSList\AtRuleBlockList
* @covers \Sabberworm\CSS\CSSList\CSSBlockList
* @covers \Sabberworm\CSS\CSSList\CSSList
*/
final class AtRuleBlockListTest extends TestCase
{
Expand Down Expand Up @@ -43,4 +45,70 @@ public function implementsCommentable(): void

self::assertInstanceOf(Commentable::class, $subject);
}

/**
* @test
*/
public function atRuleNameReturnsTypeProvidedToConstructor(): void
{
$type = 'foo';

$subject = new AtRuleBlockList($type);

self::assertSame($type, $subject->atRuleName());
}

/**
* @test
*/
public function getLineNoByDefaultReturnsZero(): void
{
$subject = new AtRuleBlockList('');

self::assertSame(0, $subject->getLineNo());
}

/**
* @test
*/
public function atRuleArgsByDefaultReturnsEmptyString(): void
{
$subject = new AtRuleBlockList('');

self::assertSame('', $subject->atRuleArgs());
}

/**
* @test
*/
public function atRuleArgsReturnsArgumentsProvidedToConstructor(): void
{
$arguments = 'bar';

$subject = new AtRuleBlockList('', $arguments);

self::assertSame($arguments, $subject->atRuleArgs());
}

/**
* @test
*/
public function getLineNoReturnsLineNumberProvidedToConstructor(): void
{
$lineNumber = 42;

$subject = new AtRuleBlockList('', '', $lineNumber);

self::assertSame($lineNumber, $subject->getLineNo());
}

/**
* @test
*/
public function isRootListAlwaysReturnsFalse(): void
{
$subject = new AtRuleBlockList('');

self::assertFalse($subject->isRootList());
}
}