subject = new class { use NormalizesEmail; public function normalize(string $email): string { return $this->normalizeEmail($email); } }; } public function test_uppercase_is_lowercased(): void { $this->assertSame('user@example.com', $this->subject->normalize('USER@EXAMPLE.COM')); } public function test_leading_and_trailing_whitespace_is_trimmed(): void { $this->assertSame('user@example.com', $this->subject->normalize(' user@example.com ')); } public function test_mixed_case_and_whitespace_are_both_normalized(): void { $this->assertSame('user@example.com', $this->subject->normalize(' User@Example.COM ')); } public function test_already_normalized_email_is_unchanged(): void { $this->assertSame('user@example.com', $this->subject->normalize('user@example.com')); } public function test_tab_whitespace_is_trimmed(): void { $this->assertSame('user@example.com', $this->subject->normalize("\tuser@example.com\t")); } }