feat: normalize email addresses to lowercase on write

This commit is contained in:
2026-09-21 12:20:55 +02:00
parent d6327f033e
commit af46c57bd1
7 changed files with 102 additions and 4 deletions
+22
View File
@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace App\Tests\Entity;
use App\Entity\Contact;
use PHPUnit\Framework\TestCase;
class ContactTest extends TestCase
{
/**
* Office contacts are normalized the same way User::setEmail() normalizes, so that every
* stored address has one shape regardless of which form wrote it.
*/
public function testSetEmailNormalizesCaseAndSurroundingWhitespace(): void
{
$contact = (new Contact())->setEmail(' [email protected] ');
$this->assertSame('[email protected]', $contact->getEmail());
}
}