feat: normalize email addresses to lowercase on write
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user