コード例 #1
0
ファイル: MatchTest.php プロジェクト: jubinpatel/horde
 public function testInsensitiveMatch()
 {
     $address = new Horde_Mail_Rfc822_Address('Test <*****@*****.**>');
     $this->assertTrue($address->matchInsensitive('Foo <*****@*****.**>'));
     $this->assertTrue($address->matchInsensitive('Foo <*****@*****.**>'));
     $this->assertTrue($address->matchInsensitive('Foo <*****@*****.**>'));
 }
コード例 #2
0
ファイル: Attendee.php プロジェクト: horde/horde
 /**
  * Returns whether an email address matches this attendee.
  *
  * @param string $email           An email address.
  * @param boolean $caseSensitive  Whether to match case-sensitive.
  *
  * @return boolean  True if the email address matches this attendee.
  */
 public function matchesEmail($email, $caseSensitive)
 {
     $email = new Horde_Mail_Rfc822_Address($email);
     return $caseSensitive && $email->match($this->email) || !$caseSensitive && $email->matchInsensitive($this->email);
 }
コード例 #3
0
ファイル: Event.php プロジェクト: GenerationLabs/horde
 /**
  * Checks to see whether the specified attendee is associated with the
  * current event.
  *
  * @param string $email            The email address of the attendee.
  * @param boolean $case_sensitive  Match in a case sensitive manner.
  *                                 @since 4.3.0
  * @return boolean  True if the specified attendee is present for this
  *                  event.
  */
 public function hasAttendee($email, $case_sensitive = false)
 {
     $email = new Horde_Mail_Rfc822_Address($email);
     foreach (array_keys($this->attendees) as $attendee) {
         if ($case_sensitive && $email->match($attendee) || !$case_sensitive && $email->matchInsensitive($email)) {
             return true;
         }
     }
     return false;
 }
コード例 #4
0
ファイル: MatchTest.php プロジェクト: x59/horde-mail
 /**
  * @dataProvider insensitiveMatchProvider
  */
 public function testInsensitiveMatch($in, $match, $expected)
 {
     $address = new Horde_Mail_Rfc822_Address($in);
     $this->assertEquals($expected, $address->matchInsensitive($match));
 }