From a1a20c49a92bba827345e4d7aa8fa649ee7fc842 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Gomez Date: Fri, 6 Sep 2024 00:25:26 +0200 Subject: [PATCH] =?UTF-8?q?Eliminada=20funci=C3=B3n=20alias()=20del=20mode?= =?UTF-8?q?lo=20Contacto.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Core/Model/Contacto.php | 18 ------------------ Test/Core/Model/ContactoTest.php | 18 ------------------ 2 files changed, 36 deletions(-) diff --git a/Core/Model/Contacto.php b/Core/Model/Contacto.php index 052ad319f..135d0076b 100644 --- a/Core/Model/Contacto.php +++ b/Core/Model/Contacto.php @@ -92,24 +92,6 @@ class Contacto extends Base\Contact /** @var string */ public $web; - public function alias(): string - { - if (empty($this->email) || strpos($this->email, '@') === false) { - return (string)$this->idcontacto; - } - - $aux = explode('@', $this->email); - switch ($aux[0]) { - case 'admin': - case 'info': - $domain = explode('.', $aux[1]); - return $domain[0] . '_' . $this->idcontacto; - - default: - return $aux[0] . '_' . $this->idcontacto; - } - } - public function checkVies(bool $msg = true): bool { $codiso = Paises::get($this->codpais)->codiso ?? ''; diff --git a/Test/Core/Model/ContactoTest.php b/Test/Core/Model/ContactoTest.php index f1fbc159a..6dae1bf1c 100644 --- a/Test/Core/Model/ContactoTest.php +++ b/Test/Core/Model/ContactoTest.php @@ -224,24 +224,6 @@ public function testVies(): void $this->assertTrue($check3); } - public function testAlias(): void - { - $contacto = new Contacto(); - $contacto->idcontacto = 999; - - $result = $contacto->alias(); - - $this->assertEquals('999', $result); - - $contacto->email = 'noreply@example.com'; - $result = $contacto->alias(); - $this->assertEquals('noreply_999', $result); - - $contacto->email = 'info@example.com'; - $result = $contacto->alias(); - $this->assertEquals('example_999', $result); - } - public function testCodeModelSearch(): void { $contact1 = $this->getRandomContact();