From dc20d3e08e91af231d38edab3319c40c2b8aaa89 Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Thu, 16 Apr 2020 21:47:36 +0800 Subject: [PATCH] =?UTF-8?q?=D0=92=20=D1=82=D0=B5=D1=81=D1=82=D0=BE=D0=B2?= =?UTF-8?q?=D0=BE=D0=BC=20=D1=80=D0=B5=D0=B6=D0=B8=D0=BC=D0=B5=20=D1=83?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA=D0=B0=20=D0=BB=D0=BE?= =?UTF-8?q?=D0=B3=D0=B8=D0=BD=D0=B0=20=D0=B8=20=D0=BF=D0=B0=D1=80=D0=BE?= =?UTF-8?q?=D0=BB=D1=8F=20=D1=82=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20=D0=BD?= =?UTF-8?q?=D0=B5=D0=BE=D0=B1=D1=8F=D0=B7=D0=B0=D1=82=D0=B5=D0=BB=D1=8C?= =?UTF-8?q?=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AtolOnline/Api/Kkt.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/AtolOnline/Api/Kkt.php b/src/AtolOnline/Api/Kkt.php index 65d9baa..2ab02ae 100644 --- a/src/AtolOnline/Api/Kkt.php +++ b/src/AtolOnline/Api/Kkt.php @@ -115,10 +115,12 @@ class Kkt extends Client */ public function setLogin(string $login) { - if (empty($login)) { - throw new AtolKktLoginEmptyException(); - } elseif (strlen($login) > 100) { - throw new AtolKktLoginTooLongException($login, 100); + if (!$this->isTestMode()) { + if (empty($login)) { + throw new AtolKktLoginEmptyException(); + } elseif (strlen($login) > 100) { + throw new AtolKktLoginTooLongException($login, 100); + } } $this->kkt_config['prod']['login'] = $login; return $this; @@ -143,8 +145,10 @@ class Kkt extends Client */ public function setPassword(string $password) { - if (empty($password)) { - throw new AtolKktPasswordEmptyException(); + if (!$this->isTestMode()) { + if (empty($password)) { + throw new AtolKktPasswordEmptyException(); + } } $this->kkt_config['prod']['pass'] = $password; return $this;