mirror of
https://github.com/Karaka-Management/oms-Comments.git
synced 2026-01-11 16:18:41 +00:00
62 lines
1.4 KiB
PHP
Executable File
62 lines
1.4 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* Orange Management
|
|
*
|
|
* PHP Version 8.0
|
|
*
|
|
* @package tests
|
|
* @copyright Dennis Eichhorn
|
|
* @license OMS License 1.0
|
|
* @version 1.0.0
|
|
* @link https://orange-management.org
|
|
*/
|
|
declare(strict_types=1);
|
|
|
|
namespace Modules\Comments\tests\Models;
|
|
|
|
use Modules\Comments\Models\Comment;
|
|
use Modules\Comments\Models\CommentList;
|
|
|
|
/**
|
|
* @internal
|
|
*/
|
|
final class CommentListTest extends \PHPUnit\Framework\TestCase
|
|
{
|
|
private CommentList $list;
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
protected function setUp() : void
|
|
{
|
|
$this->list = new CommentList();
|
|
}
|
|
|
|
/**
|
|
* @covers Modules\Comments\Models\CommentList
|
|
* @group module
|
|
*/
|
|
public function testDefault() : void
|
|
{
|
|
self::assertEquals(0, $this->list->getId());
|
|
self::assertEquals([], $this->list->getComments());
|
|
}
|
|
|
|
/**
|
|
* @covers Modules\Comments\Models\CommentList
|
|
* @group module
|
|
*/
|
|
public function testGetSet() : void
|
|
{
|
|
$comment = new Comment();
|
|
$comment->title = 'Test Title';
|
|
$comment->contentRaw = 'TestRaw';
|
|
$comment->content = 'Test Content';
|
|
|
|
$this->list->addComment($comment);
|
|
self::assertEquals('Test Title', $this->list->getComments()[0]->title);
|
|
self::assertEquals('TestRaw', $this->list->getComments()[0]->contentRaw);
|
|
self::assertEquals('Test Content', $this->list->getComments()[0]->content);
|
|
}
|
|
}
|