Esempio n. 1
0
 /**
  * @expectedException \Exception
  * @expectedExceptionMessage Some error
  */
 public function testEmulateAreaCodeException()
 {
     $areaCode = 'original code';
     $emulatedCode = 'emulated code';
     $this->scopeMock->expects($this->once())->method('setCurrentScope')->with($areaCode);
     $this->model->setAreaCode($areaCode);
     $this->model->emulateAreaCode($emulatedCode, [$this, 'emulateAreaCodeCallbackException']);
     $this->assertEquals($this->model->getAreaCode(), $areaCode);
 }
Esempio n. 2
0
 /**
  * @param int $limitTime
  * @param int $scope
  * @dataProvider dataProviderNumberValueWithScope
  */
 public function testGetMinTimeBetweenPasswordResetRequests($limitTime, $scope)
 {
     $this->scopeConfigMock->expects($this->once())->method('getValue')->with($this->getXmlPathPrefix($scope) . \Magento\Security\Model\Config::XML_PATH_MIN_TIME_BETWEEN_PASSWORD_RESET_REQUESTS)->willReturn($limitTime);
     $this->scopeMock->expects($this->once())->method('getCurrentScope')->willReturn($scope);
     $this->assertEquals($limitTime * 60, $this->model->getMinTimeBetweenPasswordResetRequests());
 }