*/
public function setEMailAddress($mailAddress) {
$oldMailAddress = $this->getEMailAddress();
- if($mailAddress === '') {
- $this->config->deleteUserValue($this->uid, 'settings', 'email');
- } else {
- $this->config->setUserValue($this->uid, 'settings', 'email', $mailAddress);
- }
if($oldMailAddress !== $mailAddress) {
+ if($mailAddress === '') {
+ $this->config->deleteUserValue($this->uid, 'settings', 'email');
+ } else {
+ $this->config->setUserValue($this->uid, 'settings', 'email', $mailAddress);
+ }
$this->triggerChange('eMailAddress', $mailAddress, $oldMailAddress);
}
}
$quota = OC_Helper::computerFileSize($quota);
$quota = OC_Helper::humanFileSize($quota);
}
- $this->config->setUserValue($this->uid, 'files', 'quota', $quota);
if($quota !== $oldQuota) {
+ $this->config->setUserValue($this->uid, 'files', 'quota', $quota);
$this->triggerChange('quota', $quota, $oldQuota);
}
}
$config->expects($this->any())
->method('getUserValue')
->willReturn('foo@bar.com');
- $config->expects($this->once())
- ->method('setUserValue')
- ->with(
- 'foo',
- 'settings',
- 'email',
- 'foo@bar.com'
- );
+ $config->expects($this->never())
+ ->method('setUserValue');
$user = new User('foo', $backend, $this->dispatcher, $emitter, $config);
$user->setEMailAddress('foo@bar.com');
$config->expects($this->any())
->method('getUserValue')
->willReturn('23 TB');
- $config->expects($this->once())
- ->method('setUserValue')
- ->with(
- 'foo',
- 'files',
- 'quota',
- '23 TB'
- );
+ $config->expects($this->never())
+ ->method('setUserValue');
$user = new User('foo', $backend, $this->dispatcher, $emitter, $config);
$user->setQuota('23 TB');