Unit test bug fixes

This commit is contained in:
Dennis Eichhorn 2016-04-24 20:47:29 +02:00
parent 7b8dfd81ea
commit 9b4ff04bfc
5 changed files with 35 additions and 4 deletions

View File

@ -47,7 +47,7 @@ class Installer extends InstallerAbstract
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'calendar` (
`calendar_id` int(11) NOT NULL AUTO_INCREMENT,
`calendar_name` varchar(25) NOT NULL,
`calendar_password` varchar(64) NOT NULL,
`calendar_password` varchar(64) DEFAULT NULL,
`calendar_description` varchar(255) NOT NULL,
`calendar_created_by` int(11) NOT NULL,
`calendar_created_at` datetime NOT NULL,
@ -108,7 +108,7 @@ class Installer extends InstallerAbstract
`calendar_event_created_by` int(11) NOT NULL,
`calendar_event_created_at` datetime NOT NULL,
`calendar_event_schedule` int(11) NOT NULL,
`calendar_event_calendar` int(11) NOT NULL,
`calendar_event_calendar` int(11) DEFAULT NULL,
PRIMARY KEY (`calendar_event_id`),
KEY `calendar_event_created_by` (`calendar_event_created_by`),
KEY `calendar_event_schedule` (`calendar_event_schedule`),

View File

@ -79,6 +79,14 @@ class Calendar
*/
private $date = null;
/**
* Password
*
* @var string
* @since 1.0.0
*/
private $password = null;
/**
* Events.
*
@ -132,6 +140,28 @@ class Calendar
$this->name = $name;
}
/**
* @return string
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getPassword()
{
return $this->password;
}
/**
* @param string $password Calendar password/title
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function setPassword($password)
{
$this->password = $password;
}
/**
* @return string
*

View File

@ -15,7 +15,6 @@
*/
namespace Modules\Calendar\Models;
use Modules\Calendar\Models\EventMapper;
use phpOMS\DataStorage\Database\DataMapperAbstract;
use phpOMS\DataStorage\Database\Query\Builder;
use phpOMS\DataStorage\Database\Query\Column;

View File

@ -115,7 +115,7 @@ class Event
* @var int
* @since 1.0.0
*/
private $calendar = 0;
private $calendar = null;
/**
* People.
@ -299,6 +299,7 @@ class Event
public function setCreatedBy(int $createdBy)
{
$this->createdBy = $createdBy;
$this->schedule->setCreatedBy($this->createdBy);
}
/**

View File

@ -104,6 +104,7 @@ class EventMapper extends DataMapperAbstract
try {
$objId = parent::create($obj);
$query = new Builder($this->db);
$query->prefix($this->db->getPrefix())
->insert(
'account_permission_account',