Fix a source value for Premium key in the worker [MAILPOET-890]
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user