Skip to content

Commit

Permalink
Eliminada función alias() del modelo Contacto.
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoRazorX committed Sep 5, 2024
1 parent eb3681a commit a1a20c4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 deletions.
18 changes: 0 additions & 18 deletions Core/Model/Contacto.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? '';
Expand Down
18 changes: 0 additions & 18 deletions Test/Core/Model/ContactoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit a1a20c4

Please sign in to comment.