/usr/share/php/tests/Horde_Share/Horde/Share/Sqlng/Base.php is in php-horde-share 2.0.4-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 | <?php
/**
* Copyright 2010-2013 Horde LLC (http://www.horde.org/)
*
* @author Jan Schneider <jan@horde.org>
* @category Horde
* @package Share
* @subpackage UnitTests
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
*/
class Horde_Share_Test_Sqlng_Base extends Horde_Share_TestBase
{
protected static $db;
protected static $reason;
public function testGetApp()
{
$this->getApp('test');
}
public function testSetTable()
{
$this->assertEquals('test_sharesng', self::$share->getTable());
self::$share->setTable('foo');
$this->assertEquals('foo', self::$share->getTable());
self::$share->setTable('test_shares');
}
public function testSetStorage()
{
self::$share->setStorage(self::$db);
$this->assertEquals(self::$db, self::$share->getStorage());
}
public function testAddShare()
{
$share = parent::addShare();
$this->assertInstanceOf('Horde_Share_Object_Sqlng', $share);
}
/**
* @depends testAddShare
*/
public function testPermissions()
{
parent::permissions();
}
/**
* @depends testAddShare
*/
public function testExists()
{
parent::exists();
}
/**
* @depends testPermissions
*/
public function testCountShares()
{
parent::countShares();
}
/**
* @depends testPermissions
*/
public function testGetShare()
{
$share = parent::getShare();
$this->assertInstanceOf('Horde_Share_Object_Sqlng', $share);
}
/**
* @depends testGetShare
*/
public function testGetShareById()
{
parent::getShareById();
}
/**
* @depends testGetShare
*/
public function testGetShares()
{
parent::getShares();
}
/**
*/
public function testGetParent()
{
$share = self::$share->getShare('myshare');
$child = self::$share->getShare('mychildshare');
$this->assertEquals($share->getId(), $child->getParent()->getId());
}
/**
* @depends testPermissions
*/
public function testListOwners()
{
$owners = self::$share->listOwners();
$this->assertInternalType('array', $owners);
$this->assertTrue(in_array('john', $owners));
}
/**
* @depends testPermissions
*/
public function testCountOwners()
{
$count = self::$share->countOwners();
$this->assertTrue($count > 0);
}
/**
* @depends testPermissions
*/
public function testListAllShares()
{
parent::listAllShares();
}
/**
* @depends testPermissions
*/
public function testListShares()
{
parent::listShares();
}
/**
* @depends testPermissions
*/
public function testListSystemShares()
{
parent::listSystemShares();
}
/**
* @depends testPermissions
*/
public function testGetPermission()
{
return $this->getPermission();
}
/**
* @depends testPermissions
*/
public function testRemoveUserPermissions()
{
return parent::removeUserPermissions();
}
/**
* @depends testRemoveUserPermissions
*/
public function testRemoveGroupPermissions()
{
parent::removeGroupPermissions();
}
/**
* @depends testGetShare
*/
public function testRemoveShare()
{
parent::removeShare();
}
/**
* @depends testGetShare
*/
public function testRenameShare()
{
parent::renameShare();
}
public function testCallback()
{
$this->callbackSetShareOb(new Horde_Share_Object_Sqlng(array()));
}
public static function setUpBeforeClass()
{
require_once __DIR__ . '/../migration/sqlng.php';
migrate_sqlng(self::$db);
$group = new Horde_Share_Stub_Group();
self::$share = new Horde_Share_Sqlng('test', 'john', new Horde_Perms_Sql(array('db' => self::$db)), $group);
self::$share->setStorage(self::$db);
// FIXME
$GLOBALS['injector'] = new Horde_Injector(new Horde_Injector_TopLevel());
$GLOBALS['injector']->setInstance('Horde_Group', $group);
}
public static function tearDownAfterClass()
{
if (self::$db) {
$migration = new Horde_Db_Migration_Base(self::$db);
$migration->dropTable('test_shares');
$migration->dropTable('test_shares_groups');
$migration->dropTable('test_shares_users');
self::$db = null;
}
}
public function setUp()
{
if (!self::$db) {
$this->markTestSkipped(self::$reason);
}
}
}
|