Fix a source value for Premium key in the worker [MAILPOET-890]

This commit is contained in:
stoletniy
2017-05-25 15:43:02 +03:00
parent afa06342a5
commit fb940065ea
2 changed files with 6 additions and 2 deletions

View File

@ -14,7 +14,7 @@ class PremiumKeyCheck extends KeyCheckWorker {
}
function checkKey() {
$premium_key = Setting::getValue(Bridge::PREMIUM_KEY_STATE_SETTING_NAME);
$premium_key = Setting::getValue(Bridge::PREMIUM_KEY_SETTING_NAME);
$result = $this->bridge->checkPremiumKey($premium_key);
return $result;
}

View File

@ -7,6 +7,7 @@ use MailPoet\Services\Bridge;
class PremiumKeyCheckTest extends MailPoetTest {
function _before() {
$this->premium_key = '123457890abcdef';
$this->worker = new PremiumKeyCheck(microtime(true));
}
@ -23,6 +24,9 @@ class PremiumKeyCheckTest extends MailPoetTest {
array('checkPremiumKey' => $response),
$this
);
$this->worker->bridge->expects($this->once())
->method('checkPremiumKey')
->with($this->equalTo($this->premium_key));
$this->fillPremiumKey();
expect($this->worker->checkKey())->equals($response);
}
@ -30,7 +34,7 @@ class PremiumKeyCheckTest extends MailPoetTest {
private function fillPremiumKey() {
Setting::setValue(
Bridge::PREMIUM_KEY_SETTING_NAME,
'123457890abcdef'
$this->premium_key
);
}