mirror of
https://github.com/Karaka-Management/oms-EventManagement.git
synced 2026-02-05 04:28:42 +00:00
Unit test fixes
This commit is contained in:
parent
7d87d7d938
commit
eb3e82febe
|
|
@ -16,6 +16,9 @@
|
||||||
namespace Modules\EventManagement\Models;
|
namespace Modules\EventManagement\Models;
|
||||||
|
|
||||||
use Modules\Calendar\Models\Event as CalendarEvent;
|
use Modules\Calendar\Models\Event as CalendarEvent;
|
||||||
|
use Modules\Tasks\Models\Task;
|
||||||
|
use phpOMS\Datatypes\Exception\InvalidEnumValue;
|
||||||
|
use phpOMS\Localization\Money;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event class.
|
* Event class.
|
||||||
|
|
@ -37,7 +40,7 @@ class Event
|
||||||
* @var int
|
* @var int
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private $id = null;
|
private $id = 0;
|
||||||
|
|
||||||
private $type = EventType::DEFAULT;
|
private $type = EventType::DEFAULT;
|
||||||
|
|
||||||
|
|
@ -101,7 +104,7 @@ class Event
|
||||||
|
|
||||||
public function getTask(int $id) : Task
|
public function getTask(int $id) : Task
|
||||||
{
|
{
|
||||||
return $this->tasks[$id] ?? new NullTask();
|
return $this->tasks[$id] ?? new Task();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTasks() : array
|
public function getTasks() : array
|
||||||
|
|
@ -121,7 +124,7 @@ class Event
|
||||||
|
|
||||||
public function setType(int $type)
|
public function setType(int $type)
|
||||||
{
|
{
|
||||||
if(!EventType::isValid($type)) {
|
if(!EventType::isValidValue($type)) {
|
||||||
throw new InvalidEnumValue($type);
|
throw new InvalidEnumValue($type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user