3
* Test the core Nag class with various backends.
9
* @subpackage UnitTests
10
* @author Gunnar Wrobel <wrobel@pardus.de>
11
* @link http://www.horde.org/apps/nag
12
* @license http://www.horde.org/licenses/gpl GNU General Public License, version 2
16
* Test the core Nag class with various backends.
18
* Copyright 2011-2013 Horde LLC (http://www.horde.org/)
20
* See the enclosed file COPYING for license information (GPLv2). If you did not
21
* receive this file, see http://www.horde.org/licenses/gpl
25
* @subpackage UnitTests
26
* @author Gunnar Wrobel <wrobel@pardus.de>
27
* @link http://www.horde.org/apps/nag
28
* @license http://www.horde.org/licenses/gpl GNU General Public License, version 2
30
class Nag_Unit_Nag_Base extends Nag_TestCase
35
* @var Horde_Test_Setup
40
* The default share name expected to be used.
44
protected $default_name = 'Task list of test@example.com';
46
public static function setUpBeforeClass()
48
self::createBasicNagSetup(self::$setup);
49
parent::setUpBeforeClass();
52
public function setUp()
54
$error = self::$setup->getError();
56
$this->markTestSkipped($error);
60
public function tearDown()
62
foreach ($GLOBALS['nag_shares']->listShares('test@example.com') as $share) {
63
$GLOBALS['nag_shares']->removeShare($share);
65
$GLOBALS['injector']->setInstance('Nag_Factory_Tasklists', null);
69
public function testCreateDefaultShare()
71
$GLOBALS['conf']['share']['auto_create'] = true;
73
$this->assertEquals(1, count($GLOBALS['display_tasklists']));
76
public function testDefaultShareName()
78
$GLOBALS['conf']['share']['auto_create'] = true;
80
$shares = $GLOBALS['nag_shares']->listShares('test@example.com');
81
$default = array_pop($shares);
88
public function testNoAutoCreate()
90
$GLOBALS['conf']['share']['auto_create'] = false;
92
$this->assertEquals(0, count($GLOBALS['display_tasklists']));
95
public function testDefaultShareDeletePermission()
97
$GLOBALS['conf']['share']['auto_create'] = true;
99
$shares = $GLOBALS['nag_shares']->listShares('test@example.com');
100
$default = array_pop($shares);
102
$default->hasPermission(
103
$GLOBALS['registry']->getAuth(), Horde_Perms::DELETE