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
Empty file removed tests/Functional/.gitkeep
Empty file.
80 changes: 80 additions & 0 deletions tests/Functional/Comment/CommentTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?php

declare(strict_types=1);

namespace Sabberworm\CSS\Tests\Functional\Comment;

use PHPUnit\Framework\TestCase;
use Sabberworm\CSS\Comment\Comment;
use Sabberworm\CSS\OutputFormat;

/**
* @covers \Sabberworm\CSS\Comment\Comment
*/
final class CommentTest extends TestCase
{
/**
* @test
*/
public function toStringRendersCommentEnclosedInCommentDelimiters(): void
{
$comment = 'There is no spoon.';
$subject = new Comment();

$subject->setComment($comment);

self::assertSame('/*' . $comment . '*/', (string) $subject);
}

/**
* @test
*/
public function renderWithVirginOutputFormatRendersCommentEnclosedInCommentDelimiters(): void
{
$comment = 'There is no spoon.';
$subject = new Comment();

$subject->setComment($comment);

self::assertSame('/*' . $comment . '*/', $subject->render(new OutputFormat()));
}

/**
* @test
*/
public function renderWithDefaultOutputFormatRendersCommentEnclosedInCommentDelimiters(): void
{
$comment = 'There is no spoon.';
$subject = new Comment();

$subject->setComment($comment);

self::assertSame('/*' . $comment . '*/', $subject->render(OutputFormat::create()));
}

/**
* @test
*/
public function renderWithCompactOutputFormatRendersCommentEnclosedInCommentDelimiters(): void
{
$comment = 'There is no spoon.';
$subject = new Comment();

$subject->setComment($comment);

self::assertSame('/*' . $comment . '*/', $subject->render(OutputFormat::createCompact()));
}

/**
* @test
*/
public function renderWithPrettyOutputFormatRendersCommentEnclosedInCommentDelimiters(): void
{
$comment = 'There is no spoon.';
$subject = new Comment();

$subject->setComment($comment);

self::assertSame('/*' . $comment . '*/', $subject->render(OutputFormat::createPretty()));
}
}
27 changes: 0 additions & 27 deletions tests/Unit/Comment/CommentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use PHPUnit\Framework\TestCase;
use Sabberworm\CSS\Comment\Comment;
use Sabberworm\CSS\OutputFormat;
use Sabberworm\CSS\Renderable;

/**
Expand Down Expand Up @@ -78,30 +77,4 @@ public function getLineNoInitiallyReturnsLineNumberPassedToConstructor(): void

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

/**
* @test
*/
public function toStringRendersCommentEnclosedInCommentDelimiters(): void
{
$comment = 'There is no spoon.';
$subject = new Comment();

$subject->setComment($comment);

self::assertSame('/*' . $comment . '*/', (string) $subject);
}

/**
* @test
*/
public function renderRendersCommentEnclosedInCommentDelimiters(): void
{
$comment = 'There is no spoon.';
$subject = new Comment();

$subject->setComment($comment);

self::assertSame('/*' . $comment . '*/', $subject->render(new OutputFormat()));
}
}