예제 #1
0
 /**
  * Validate a domain name value
  *
  * @return void
  * @throws \Magento\Framework\Exception\LocalizedException
  */
 public function beforeSave()
 {
     $value = $this->getValue();
     if (!empty($value) && !$this->configValidator->isValid($value)) {
         $msg = __('Invalid cookie lifetime: ' . join('; ', $this->configValidator->getMessages()));
         throw new \Magento\Framework\Exception\LocalizedException($msg);
     }
 }
 public function testZero()
 {
     $this->assertTrue($this->model->isValid(0));
 }