public function testUnlock()
 {
     $customerId = 1;
     $this->customerRegistryMock->expects($this->once())->method('retrieveSecureData')->with($customerId)->willReturn($this->customerSecureMock);
     $this->customerAuthUpdate->expects($this->once())->method('saveAuth')->with($customerId)->willReturnSelf();
     $this->customerSecureMock->expects($this->once())->method('setFailuresNum')->with(0);
     $this->customerSecureMock->expects($this->once())->method('setFirstFailure')->with(null);
     $this->customerSecureMock->expects($this->once())->method('setLockExpires')->with(null);
     $this->authentication->unlock($customerId);
 }
Esempio n. 2
0
 /**
  * @return void
  */
 public function testProcessUnlockData()
 {
     $customerId = 1;
     $this->customerRegistryMock->expects($this->once())->method('retrieveSecureData')->with($customerId)->willReturn($this->customerSecure);
     $customerMock = $this->getMockBuilder(CustomerInterface::class)->disableOriginalConstructor()->getMock();
     $this->customerRepositoryMock->expects($this->once())->method('getById')->with($customerId)->willReturn($customerMock);
     $this->customerRepositoryMock->expects($this->once())->method('save')->with($customerMock);
     $this->customerSecure->expects($this->once())->method('setFailuresNum')->with(0);
     $this->customerSecure->expects($this->once())->method('setFirstFailure')->with(null);
     $this->customerSecure->expects($this->once())->method('setLockExpires')->with(null);
     $this->authentication->unlock($customerId);
 }