Skip to content

Commit

Permalink
Fix unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Apr 28, 2015
1 parent 4572fdf commit 998f61a
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 4 deletions.
20 changes: 20 additions & 0 deletions kronolith/lib/Event/Mock.php
@@ -0,0 +1,20 @@
<?php
/**
* Copyright 1999-2015 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (GPL). If you
* did not receive this file, see http://www.horde.org/licenses/gpl.
*
* @author Jan Schneider <jan@horde.org>
* @package Kronolith
*/

/**
* Event class implementation for the mock driver.
*
* @author Jan Schneider <jan@horde.org>
* @package Kronolith
*/
class Kronolith_Event_Mock extends Kronolith_Event
{
}
3 changes: 2 additions & 1 deletion kronolith/lib/Factory/Driver.php
Expand Up @@ -59,7 +59,8 @@ public function create($driver, array $params = array())
switch ($driver) {
case 'Sql':
$params = array_merge(Horde::getDriverConfig('calendar', 'sql'), $params);
if ($params['driverconfig'] != 'horde') {
if (isset($params['driverconfig']) &&
$params['driverconfig'] != 'horde') {
$customParams = $params;
unset($customParams['driverconfig'], $customParams['table'], $customParams['utc']);
$params['db'] = $this->_injector->getInstance('Horde_Core_Factory_Db')->create('kronolith', $customParams);
Expand Down
6 changes: 4 additions & 2 deletions kronolith/package.xml
Expand Up @@ -22,7 +22,7 @@
<email>chuck@horde.org</email>
<active>no</active>
</lead>
<date>2015-03-18</date>
<date>2015-04-28</date>
<version>
<release>4.2.6</release>
<api>4.2.0</api>
Expand Down Expand Up @@ -163,6 +163,7 @@
<file name="Horde.php" role="horde" />
<file name="Ical.php" role="horde" />
<file name="Kolab.php" role="horde" />
<file name="Mock.php" role="horde" />
<file name="Sql.php" role="horde" />
</dir> <!-- /lib/Event -->
<dir name="Factory">
Expand Down Expand Up @@ -1187,6 +1188,7 @@
<install as="kronolith/lib/Event/Horde.php" name="lib/Event/Horde.php" />
<install as="kronolith/lib/Event/Ical.php" name="lib/Event/Ical.php" />
<install as="kronolith/lib/Event/Kolab.php" name="lib/Event/Kolab.php" />
<install as="kronolith/lib/Event/Mock.php" name="lib/Event/Mock.php" />
<install as="kronolith/lib/Event/Sql.php" name="lib/Event/Sql.php" />
<install as="kronolith/lib/Event/Resource/Sql.php" name="lib/Event/Resource/Sql.php" />
<install as="kronolith/lib/Factory/Calendars.php" name="lib/Factory/Calendars.php" />
Expand Down Expand Up @@ -2533,7 +2535,7 @@
<stability>
<release>stable</release>
<api>stable</api></stability>
<date>2015-03-17</date>
<date>2015-04-28</date>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
* [jan] Fix building recipient list for event update notifications.
Expand Down
2 changes: 1 addition & 1 deletion kronolith/test/Kronolith/Integration/ToIcalendarTest.php
Expand Up @@ -91,7 +91,7 @@ private function _removeDateStamp($ics)
private function _getEvent()
{
$GLOBALS['registry']->admin = true;
$event = new Kronolith_Event_Sql(new Kronolith_Stub_Driver(''));
$event = new Kronolith_Event_Mock(new Kronolith_Stub_Driver(''));
$event->start = new Horde_Date('2007-03-15 13:10:20');
$event->end = new Horde_Date('2007-03-15 14:20:00');
$event->uid = '20070315143732.4wlenqz3edq8@horde.org';
Expand Down
5 changes: 5 additions & 0 deletions kronolith/test/Kronolith/Stub/Registry.php
Expand Up @@ -8,4 +8,9 @@ public function isAdmin(array $options = array())
{
return $this->admin;
}

public function pushApp($app)
{
return false;
}
}

0 comments on commit 998f61a

Please sign in to comment.