<?php
namespace nur\data\types;

use nur\t\TestCase;

class MailTypeTest extends TestCase {
  function testWith() {
    $type = new MailType();
    self::assertSame("jephte.clain@univ-reunion.fr", $type->with("  Jephte.Clain@univ-reunion.fr  "));
    self::assertSame("jephte.clain@univ-reunion.fr", $type->with("  Jephte.Clain  @  univ-reunion.fr  "));
    self::assertSame("ADMIN@univ-reunion.fr", $type->with("  ADMIN@univ-reunion.fr  "));
    self::assertSame("jephte.clain+MAILBOX@univ-reunion.fr", $type->with("JEPHTE.CLAIN+MAILBOX@UNIV-REUNION.FR"));
    self::assertSame("JEPHTECLAIN+MAILBOX@univ-reunion.fr", $type->with("JEPHTECLAIN+MAILBOX@UNIV-REUNION.FR"));
    self::assertSame("jephte.clain!+MAILBOX@univ-reunion.fr", $type->with("JEPHTE.CLAIN!+MAILBOX@UNIV-REUNION.FR"));
    self::assertSame("prenom_nom@yahoo.fr", $type->with("prenom_nom@yahoo.fr"));
  }
}
