2022-07-05 14:08:14 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2023-11-09 10:27:43 +01:00
|
|
|
namespace WerkraumMedia\Events\Tests\Unit\Domain\Model;
|
2022-07-05 14:08:14 +02:00
|
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
2023-11-09 10:27:43 +01:00
|
|
|
use WerkraumMedia\Events\Domain\Model\Category;
|
2022-07-05 14:08:14 +02:00
|
|
|
|
|
|
|
/**
|
2023-11-09 10:27:43 +01:00
|
|
|
* @covers \WerkraumMedia\Events\Domain\Model\Category
|
2022-07-05 14:08:14 +02:00
|
|
|
*/
|
|
|
|
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'));
|
|
|
|
}
|
|
|
|
}
|