|
@@ 171-212 (lines=42) @@
|
| 168 |
|
$user->updateEmail(); |
| 169 |
|
} |
| 170 |
|
|
| 171 |
|
public function testUpdateQuotaAllProvided() { |
| 172 |
|
list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = |
| 173 |
|
$this->getTestInstances(); |
| 174 |
|
|
| 175 |
|
list($access, $connection) = |
| 176 |
|
$this->getAdvancedMocks($config, $filesys, $log, $avaMgr, $dbc); |
| 177 |
|
|
| 178 |
|
$connection->expects($this->at(0)) |
| 179 |
|
->method('__get') |
| 180 |
|
->with($this->equalTo('ldapQuotaDefault')) |
| 181 |
|
->will($this->returnValue('23 GB')); |
| 182 |
|
|
| 183 |
|
$connection->expects($this->at(1)) |
| 184 |
|
->method('__get') |
| 185 |
|
->with($this->equalTo('ldapQuotaAttribute')) |
| 186 |
|
->will($this->returnValue('myquota')); |
| 187 |
|
|
| 188 |
|
$connection->expects($this->exactly(2)) |
| 189 |
|
->method('__get'); |
| 190 |
|
|
| 191 |
|
$access->expects($this->once()) |
| 192 |
|
->method('readAttribute') |
| 193 |
|
->with($this->equalTo('uid=alice,dc=foo,dc=bar'), |
| 194 |
|
$this->equalTo('myquota')) |
| 195 |
|
->will($this->returnValue(array('42 GB'))); |
| 196 |
|
|
| 197 |
|
$config->expects($this->once()) |
| 198 |
|
->method('setUserValue') |
| 199 |
|
->with($this->equalTo('alice'), |
| 200 |
|
$this->equalTo('files'), |
| 201 |
|
$this->equalTo('quota'), |
| 202 |
|
$this->equalTo('42 GB')) |
| 203 |
|
->will($this->returnValue(true)); |
| 204 |
|
|
| 205 |
|
$uid = 'alice'; |
| 206 |
|
$dn = 'uid=alice,dc=foo,dc=bar'; |
| 207 |
|
|
| 208 |
|
$user = new User( |
| 209 |
|
$uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr); |
| 210 |
|
|
| 211 |
|
$user->updateQuota(); |
| 212 |
|
} |
| 213 |
|
|
| 214 |
|
public function testUpdateQuotaDefaultProvided() { |
| 215 |
|
list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = |
|
@@ 214-255 (lines=42) @@
|
| 211 |
|
$user->updateQuota(); |
| 212 |
|
} |
| 213 |
|
|
| 214 |
|
public function testUpdateQuotaDefaultProvided() { |
| 215 |
|
list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = |
| 216 |
|
$this->getTestInstances(); |
| 217 |
|
|
| 218 |
|
list($access, $connection) = |
| 219 |
|
$this->getAdvancedMocks($config, $filesys, $log, $avaMgr, $dbc); |
| 220 |
|
|
| 221 |
|
$connection->expects($this->at(0)) |
| 222 |
|
->method('__get') |
| 223 |
|
->with($this->equalTo('ldapQuotaDefault')) |
| 224 |
|
->will($this->returnValue('25 GB')); |
| 225 |
|
|
| 226 |
|
$connection->expects($this->at(1)) |
| 227 |
|
->method('__get') |
| 228 |
|
->with($this->equalTo('ldapQuotaAttribute')) |
| 229 |
|
->will($this->returnValue('myquota')); |
| 230 |
|
|
| 231 |
|
$connection->expects($this->exactly(2)) |
| 232 |
|
->method('__get'); |
| 233 |
|
|
| 234 |
|
$access->expects($this->once()) |
| 235 |
|
->method('readAttribute') |
| 236 |
|
->with($this->equalTo('uid=alice,dc=foo,dc=bar'), |
| 237 |
|
$this->equalTo('myquota')) |
| 238 |
|
->will($this->returnValue(false)); |
| 239 |
|
|
| 240 |
|
$config->expects($this->once()) |
| 241 |
|
->method('setUserValue') |
| 242 |
|
->with($this->equalTo('alice'), |
| 243 |
|
$this->equalTo('files'), |
| 244 |
|
$this->equalTo('quota'), |
| 245 |
|
$this->equalTo('25 GB')) |
| 246 |
|
->will($this->returnValue(true)); |
| 247 |
|
|
| 248 |
|
$uid = 'alice'; |
| 249 |
|
$dn = 'uid=alice,dc=foo,dc=bar'; |
| 250 |
|
|
| 251 |
|
$user = new User( |
| 252 |
|
$uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr); |
| 253 |
|
|
| 254 |
|
$user->updateQuota(); |
| 255 |
|
} |
| 256 |
|
|
| 257 |
|
public function testUpdateQuotaIndividualProvided() { |
| 258 |
|
list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = |
|
@@ 257-298 (lines=42) @@
|
| 254 |
|
$user->updateQuota(); |
| 255 |
|
} |
| 256 |
|
|
| 257 |
|
public function testUpdateQuotaIndividualProvided() { |
| 258 |
|
list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = |
| 259 |
|
$this->getTestInstances(); |
| 260 |
|
|
| 261 |
|
list($access, $connection) = |
| 262 |
|
$this->getAdvancedMocks($config, $filesys, $log, $avaMgr, $dbc); |
| 263 |
|
|
| 264 |
|
$connection->expects($this->at(0)) |
| 265 |
|
->method('__get') |
| 266 |
|
->with($this->equalTo('ldapQuotaDefault')) |
| 267 |
|
->will($this->returnValue('')); |
| 268 |
|
|
| 269 |
|
$connection->expects($this->at(1)) |
| 270 |
|
->method('__get') |
| 271 |
|
->with($this->equalTo('ldapQuotaAttribute')) |
| 272 |
|
->will($this->returnValue('myquota')); |
| 273 |
|
|
| 274 |
|
$connection->expects($this->exactly(2)) |
| 275 |
|
->method('__get'); |
| 276 |
|
|
| 277 |
|
$access->expects($this->once()) |
| 278 |
|
->method('readAttribute') |
| 279 |
|
->with($this->equalTo('uid=alice,dc=foo,dc=bar'), |
| 280 |
|
$this->equalTo('myquota')) |
| 281 |
|
->will($this->returnValue(array('27 GB'))); |
| 282 |
|
|
| 283 |
|
$config->expects($this->once()) |
| 284 |
|
->method('setUserValue') |
| 285 |
|
->with($this->equalTo('alice'), |
| 286 |
|
$this->equalTo('files'), |
| 287 |
|
$this->equalTo('quota'), |
| 288 |
|
$this->equalTo('27 GB')) |
| 289 |
|
->will($this->returnValue(true)); |
| 290 |
|
|
| 291 |
|
$uid = 'alice'; |
| 292 |
|
$dn = 'uid=alice,dc=foo,dc=bar'; |
| 293 |
|
|
| 294 |
|
$user = new User( |
| 295 |
|
$uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr); |
| 296 |
|
|
| 297 |
|
$user->updateQuota(); |
| 298 |
|
} |
| 299 |
|
|
| 300 |
|
public function testUpdateQuotaNoneProvided() { |
| 301 |
|
list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = |