Skip to content
Merged
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions tests/Unit/CSSList/AtRuleBlockListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use PHPUnit\Framework\TestCase;
use Sabberworm\CSS\Comment\Commentable;
use Sabberworm\CSS\CSSList\AtRuleBlockList;
use Sabberworm\CSS\CSSList\CSSBlockList;
use Sabberworm\CSS\CSSList\CSSList;
use Sabberworm\CSS\Renderable;

Expand Down Expand Up @@ -51,6 +52,16 @@ public function implementsCommentable(): void
self::assertInstanceOf(Commentable::class, $subject);
}

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

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

/**
* @test
*/
Expand Down
48 changes: 48 additions & 0 deletions tests/Unit/CSSList/CSSBlockListTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Tests\Unit\CSSList;

use PHPUnit\Framework\TestCase;
use Sabberworm\CSS\Comment\Commentable;
use Sabberworm\CSS\CSSList\CSSList;
use Sabberworm\CSS\Renderable;
use Sabberworm\CSS\Tests\Unit\CSSList\Fixtures\ConcreteCSSBlockList;

/**
* @covers \Sabberworm\CSS\CSSList\CSSBlockList
* @covers \Sabberworm\CSS\CSSList\CSSList
*/
final class CSSBlockListTest extends TestCase
{
/**
* @test
*/
public function implementsRenderable(): void
{
$subject = new ConcreteCSSBlockList();

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

/**
* @test
*/
public function implementsCommentable(): void
{
$subject = new ConcreteCSSBlockList();

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

/**
* @test
*/
public function isCSSList(): void
{
$subject = new ConcreteCSSBlockList();

self::assertInstanceOf(CSSList::class, $subject);
}
}
11 changes: 11 additions & 0 deletions tests/Unit/CSSList/DocumentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use PHPUnit\Framework\TestCase;
use Sabberworm\CSS\Comment\Commentable;
use Sabberworm\CSS\CSSList\AtRuleBlockList;
use Sabberworm\CSS\CSSList\CSSBlockList;
use Sabberworm\CSS\CSSList\CSSList;
use Sabberworm\CSS\CSSList\Document;
use Sabberworm\CSS\Property\Charset;
Expand Down Expand Up @@ -43,6 +44,16 @@ public function implementsCommentable(): void
self::assertInstanceOf(Commentable::class, new Document());
}

/**
* @test
*/
public function isCSSBlockList(): void
{
$subject = new Document();

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

/**
* @test
*/
Expand Down
21 changes: 21 additions & 0 deletions tests/Unit/CSSList/Fixtures/ConcreteCSSBlockList.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Tests\Unit\CSSList\Fixtures;

use Sabberworm\CSS\CSSList\CSSBlockList;
use Sabberworm\CSS\OutputFormat;

final class ConcreteCSSBlockList extends CSSBlockList
{
public function isRootList(): bool
{
throw new \BadMethodCallException('Not implemented', 1740395831);
}

public function render(OutputFormat $outputFormat): string
{
throw new \BadMethodCallException('Not implemented', 1740395836);
}
}