mirror of
https://github.com/werkraum-media/events.git
synced 2024-11-25 02:36:10 +01:00
Daniel Siepmann
27ee70d0cf
A new PSR-14 event is added that allows to modify the categories to be assigned to an event. The event itself (including already existing categories) as well as the list of categories to be used after import are available. It is possible to change the categories to be assigned, e.g. keep some of the existing categories. That way it is possible for installations to add custom categories to events. Relates: #10623
78 lines
1.3 KiB
PHP
78 lines
1.3 KiB
PHP
<?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
|
|
{
|
|
$subject = new Category(
|
|
null,
|
|
10,
|
|
'Title',
|
|
false
|
|
);
|
|
|
|
self::assertInstanceOf(
|
|
Category::class,
|
|
$subject
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @test
|
|
*/
|
|
public function returnsSorting(): void
|
|
{
|
|
$subject = new Category(
|
|
null,
|
|
10,
|
|
'Title',
|
|
false
|
|
);
|
|
$subject->_setProperty('sorting', 10);
|
|
|
|
self::assertSame(10, $subject->getSorting());
|
|
}
|
|
|
|
/**
|
|
* @test
|
|
*/
|
|
public function canBeVisible(): void
|
|
{
|
|
$subject = new Category(
|
|
null,
|
|
10,
|
|
'Title',
|
|
false
|
|
);
|
|
|
|
self::assertFalse($subject->_getProperty('hidden'));
|
|
}
|
|
|
|
/**
|
|
* @test
|
|
*/
|
|
public function canHide(): void
|
|
{
|
|
$subject = new Category(
|
|
null,
|
|
10,
|
|
'Title',
|
|
true
|
|
);
|
|
|
|
self::assertTrue($subject->_getProperty('hidden'));
|
|
}
|
|
}
|