@example.com', false), // Disallowed Characters array('test@.', false), array('test@example.', false), array('test@.org', false), array('12345678901234567890123456789012345678901234567890123456789012345@example.com', false), // 64 characters is maximum length for local part. This is 65. array('test@123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012.com', false), // 255 characters is maximum length for domain. This is 256. array('test@[123.123.123.123', false), array('test@123.123.123.123]', false), ); } /** * @dataProvider provider * @param string $input * @param bool $success */ function test1($input, $success) { $result = mail_isvalid($input); $this->assertSame($success, $result); } }