22 private $otpResponseResolver;
27 private $updateResponseResolver;
37 private $notifyDataChangedResponseResolver;
54 'UpdateResponseResolver' 57 'NotifyDataChangedResponseResolver' 69 $body = $this->converter->toBody([
'test' =>
'42']);
70 $retryResponse = new \Zend_Http_Response(401, [$this->converter->getContentTypeHeader()], $body);
71 $this->otpResponseResolver->getResult($retryResponse);
72 $this->assertCronWasSet();
81 $body = $this->converter->toBody([
'test' =>
'42']);
82 $successResponse = new \Zend_Http_Response(201, [$this->converter->getContentTypeHeader()], $body);
83 $this->otpResponseResolver->getResult($successResponse);
84 $this->assertCronWasNotSet();
93 $body = $this->converter->toBody([
'test' =>
'42']);
94 $retryResponse = new \Zend_Http_Response(401, [$this->converter->getContentTypeHeader()], $body);
95 $this->updateResponseResolver->getResult($retryResponse);
96 $this->assertCronWasSet();
105 $body = $this->converter->toBody([
'test' =>
'42']);
106 $successResponse = new \Zend_Http_Response(201, [$this->converter->getContentTypeHeader()], $body);
107 $this->updateResponseResolver->getResult($successResponse);
108 $this->assertCronWasNotSet();
120 'https://previous.example.com/' 122 $body = $this->converter->toBody([
'test' =>
'42']);
123 $retryResponse = new \Zend_Http_Response(401, [$this->converter->getContentTypeHeader()], $body);
124 $this->notifyDataChangedResponseResolver->getResult($retryResponse);
125 $this->assertCronWasNotSet();
131 private function getSubscribeSchedule()
139 return $scopeConfig->getValue(
149 private function getAttemptFlag()
163 private function assertCronWasSet()
165 $this->assertEquals(
'0 * * * *', $this->getSubscribeSchedule());
166 $this->assertGreaterThan(1, $this->getAttemptFlag());
172 private function assertCronWasNotSet()
174 $this->assertNull($this->getSubscribeSchedule());
175 $this->assertNull($this->getAttemptFlag());
testReSignUpOnNotifyDataChangedWasNotCalledWhenSubscriptionUpdateIsRunning()
testReSignUpOnUpdateWasCalled()
testReSignOnOtpWasNotCalled()
testReSignUpOnUpdateWasNotCalled()
const PREVIOUS_BASE_URL_FLAG_CODE
const ATTEMPTS_REVERSE_COUNTER_FLAG_CODE
static getObjectManager()