Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Feb 9, 2015
1 parent 06adecf commit 1bf51f7
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
File renamed without changes.
7 changes: 0 additions & 7 deletions ingo/lib/Storage/Forward.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,6 @@ public function setForwardKeep($data)
*/
public function getForwardAddresses()
{
if (is_array($this->_addr)) {
foreach ($this->_addr as $key => $val) {
if (empty($val)) {
unset($this->_addr[$key]);
}
}
}
return $this->_addr;
}

Expand Down
10 changes: 5 additions & 5 deletions ingo/test/Ingo/Stub/Storage/Mock.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ protected function _retrieve($field, $readonly = false)
return new Ingo_Storage_Blacklist();

case self::ACTION_FILTERS:
include INGO_BASE . '/config/prefs.php';
$ob = new Ingo_Storage_Filters_Memory(
unserialize($_prefs['rules']['value'])
);
return $ob;
return new Ingo_Storage_Filters_Memory();

case self::ACTION_FORWARD:
return new Ingo_Storage_Forward();
Expand Down Expand Up @@ -67,4 +63,8 @@ protected function _store($ob)
$this->_data[$ob->obType()] = $ob;
}

protected function _removeUserData($user)
{
}

}
6 changes: 6 additions & 0 deletions ingo/test/Ingo/Unit/ProcmailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ public function testVacationDisabled()
$vacation->setVacationReason("Because I don't like working!");

$this->storage->store($vacation);

$filters = $this->storage->retrieve(Ingo_Storage::ACTION_FILTERS);
$filters->ruleDisable(
$filters->findRuleId(Ingo_Storage::ACTION_VACATION)
);

$this->_assertScript('');
}

Expand Down
10 changes: 10 additions & 0 deletions ingo/test/Ingo/Unit/SieveTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ public function testVacationDisabled()

$this->storage->store($vacation);

$filters = $this->storage->retrieve(Ingo_Storage::ACTION_FILTERS);
$filters->ruleDisable(
$filters->findRuleId(Ingo_Storage::ACTION_VACATION)
);

$this->_assertScript('');
}

Expand Down Expand Up @@ -145,6 +150,11 @@ public function testSpamDisabled()

$this->storage->store($spam);

$filters = $this->storage->retrieve(Ingo_Storage::ACTION_FILTERS);
$filters->ruleDisable(
$filters->findRuleId(Ingo_Storage::ACTION_SPAM)
);

$this->_assertScript('');
}

Expand Down

0 comments on commit 1bf51f7

Please sign in to comment.