Skip to content

Add unit tests for interface implementation in CSSList classes #382

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
Aug 1, 2022
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
33 changes: 33 additions & 0 deletions tests/CSSList/AtRuleBlockListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,46 @@
namespace Sabberworm\CSS\Tests\CSSList;

use PHPUnit\Framework\TestCase;
use Sabberworm\CSS\Comment\Commentable;
use Sabberworm\CSS\CSSList\AtRuleBlockList;
use Sabberworm\CSS\Parser;
use Sabberworm\CSS\Renderable;

/**
* @covers \Sabberworm\CSS\CSSList\AtRuleBlockList
*/
class AtRuleBlockListTest extends TestCase
{
/**
* @test
*/
public function implementsAtRule()
{
$subject = new AtRuleBlockList('');

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

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

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

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

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

/**
* @return array<string, array<int, string>>
*/
Expand Down
18 changes: 18 additions & 0 deletions tests/CSSList/DocumentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
namespace Sabberworm\CSS\Tests\CSSList;

use PHPUnit\Framework\TestCase;
use Sabberworm\CSS\Comment\Commentable;
use Sabberworm\CSS\CSSList\Document;
use Sabberworm\CSS\Renderable;
use Sabberworm\CSS\RuleSet\DeclarationBlock;

/**
Expand All @@ -21,6 +23,22 @@ protected function setUp()
$this->subject = new Document();
}

/**
* @test
*/
public function implementsRenderable()
{
self::assertInstanceOf(Renderable::class, $this->subject);
}

/**
* @test
*/
public function implementsCommentable()
{
self::assertInstanceOf(Commentable::class, $this->subject);
}

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

namespace Sabberworm\CSS\Tests\CSSList;

use PHPUnit\Framework\TestCase;
use Sabberworm\CSS\Comment\Commentable;
use Sabberworm\CSS\CSSList\KeyFrame;
use Sabberworm\CSS\Property\AtRule;
use Sabberworm\CSS\Renderable;

/**
* @covers \Sabberworm\CSS\CSSList\KeyFrame
*/
class KeyFrameTest extends TestCase
{
/**
* @var KeyFrame
*/
protected $subject;

protected function setUp()
{
$this->subject = new KeyFrame();
}

/**
* @test
*/
public function implementsAtRule()
{
self::assertInstanceOf(AtRule::class, $this->subject);
}

/**
* @test
*/
public function implementsRenderable()
{
self::assertInstanceOf(Renderable::class, $this->subject);
}

/**
* @test
*/
public function implementsCommentable()
{
self::assertInstanceOf(Commentable::class, $this->subject);
}
}