Separate checking and storing of the keys [MAILPOET-939]

This commit is contained in:
stoletniy
2017-06-15 13:00:56 +03:00
parent 181d7b9876
commit 1aba3112e9
8 changed files with 185 additions and 69 deletions

View File

@ -21,12 +21,21 @@ class PremiumKeyCheckTest extends MailPoetTest {
$response = array('code' => Bridge::PREMIUM_KEY_VALID);
$this->worker->bridge = Stub::make(
new Bridge,
array('checkPremiumKey' => $response),
array(
'checkPremiumKey' => $response,
'storePremiumKeyAndState' => null
),
$this
);
$this->worker->bridge->expects($this->once())
->method('checkPremiumKey')
->with($this->equalTo($this->premium_key));
$this->worker->bridge->expects($this->once())
->method('storePremiumKeyAndState')
->with(
$this->equalTo($this->premium_key),
$this->equalTo($response)
);
$this->fillPremiumKey();
expect($this->worker->checkKey())->equals($response);
}