Skip to content

Commit

Permalink
Fix testing errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Mar 28, 2014
1 parent 4652802 commit f3e6e12
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions kronolith/test/Kronolith/Autoload.php
Expand Up @@ -27,3 +27,4 @@
require_once __DIR__ . '/Stub/ShareFactory.php';
require_once __DIR__ . '/Stub/Tagger.php';
require_once __DIR__ . '/Stub/Types.php';
require_once __DIR__ . '/Stub/CalendarManager.php';
5 changes: 5 additions & 0 deletions kronolith/test/Kronolith/Integration/AllDayTest.php
Expand Up @@ -29,6 +29,11 @@
*/
class Kronolith_Integration_AllDayTest extends Kronolith_TestCase
{
static public function setupBeforeClass()
{
$GLOBALS['calendar_manager'] = new Kronolith_Stub_CalendarManager();
}

public function testAllDay()
{
$ical_event = $this->_getFixture(0);
Expand Down
4 changes: 2 additions & 2 deletions kronolith/test/Kronolith/Integration/Kronolith/Base.php
Expand Up @@ -81,7 +81,7 @@ public function testCreateDefaultShare()
{
$GLOBALS['conf']['share']['auto_create'] = true;
Kronolith::initialize();
$this->assertEquals(1, count($GLOBALS['display_calendars']));
$this->assertEquals(1, count($GLOBALS['calendar_manager']->get(Kronolith::DISPLAY_CALENDARS)));
}

public function testDefaultShareName()
Expand All @@ -100,7 +100,7 @@ public function testNoAutoCreate()
{
$GLOBALS['conf']['share']['auto_create'] = false;
Kronolith::initialize();
$this->assertEquals(0, count($GLOBALS['display_calendars']));
$this->assertEquals(0, count($GLOBALS['calendar_manager']->get(Kronolith::DISPLAY_CALENDARS)));
}

public function testDefaultShareDeletePermission()
Expand Down
14 changes: 14 additions & 0 deletions kronolith/test/Kronolith/Stub/CalendarManager.php
@@ -0,0 +1,14 @@
<?php

class Kronolith_Stub_CalendarManager
{
public function __construct($calendar = 'foo')
{
}

public function getEntry($list, $entry)
{
return false;
}

}
1 change: 1 addition & 0 deletions kronolith/test/Kronolith/TestCase.php
Expand Up @@ -72,6 +72,7 @@ static protected function createBasicKronolithSetup(Horde_Test_Setup $setup)
$GLOBALS['conf']['prefs']['driver'] = 'Null';
$GLOBALS['conf']['sql']['charset'] = 'utf-8';
$GLOBALS['conf']['sql']['driverconfig'] = 'Horde';
$GLOBALS['calendar_manager'] = new Kronolith_Stub_CalendarManager();
}

static protected function createSqlShares(Horde_Test_Setup $setup)
Expand Down

0 comments on commit f3e6e12

Please sign in to comment.