2022-07-05 14:08:14 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace Wrm\Events\Tests\Unit\Domain\Model;
|
|
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
use Wrm\Events\Domain\Model\Category;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @covers \Wrm\Events\Domain\Model\Category
|
|
|
|
*/
|
|
|
|
class CategoryTest extends TestCase
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
public function canBeCreated(): void
|
|
|
|
{
|
2023-08-14 12:09:28 +02:00
|
|
|
$subject = new Category(
|
|
|
|
null,
|
|
|
|
10,
|
|
|
|
'Title',
|
|
|
|
false
|
|
|
|
);
|
2022-07-05 14:08:14 +02:00
|
|
|
|
|
|
|
self::assertInstanceOf(
|
|
|
|
Category::class,
|
|
|
|
$subject
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
public function returnsSorting(): void
|
|
|
|
{
|
2023-08-14 12:09:28 +02:00
|
|
|
$subject = new Category(
|
|
|
|
null,
|
|
|
|
10,
|
|
|
|
'Title',
|
|
|
|
false
|
|
|
|
);
|
2022-07-05 14:08:14 +02:00
|
|
|
$subject->_setProperty('sorting', 10);
|
|
|
|
|
|
|
|
self::assertSame(10, $subject->getSorting());
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
2023-08-14 12:09:28 +02:00
|
|
|
public function canBeVisible(): void
|
2022-07-05 14:08:14 +02:00
|
|
|
{
|
2023-08-14 12:09:28 +02:00
|
|
|
$subject = new Category(
|
|
|
|
null,
|
|
|
|
10,
|
|
|
|
'Title',
|
|
|
|
false
|
|
|
|
);
|
2022-07-05 14:08:14 +02:00
|
|
|
|
|
|
|
self::assertFalse($subject->_getProperty('hidden'));
|
2023-08-14 12:09:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
public function canHide(): void
|
|
|
|
{
|
|
|
|
$subject = new Category(
|
|
|
|
null,
|
|
|
|
10,
|
|
|
|
'Title',
|
|
|
|
true
|
|
|
|
);
|
2022-07-05 14:08:14 +02:00
|
|
|
|
|
|
|
self::assertTrue($subject->_getProperty('hidden'));
|
|
|
|
}
|
|
|
|
}
|