コード例 #1
0
ファイル: AddressHandlerTest.php プロジェクト: mast3rpee/blw
 /**
  * @depends test_addBCC
  * @covers ::getBCC
  */
 public function test_getBCC()
 {
     $Email = new GenericEmailAddress('*****@*****.**', 'Test User');
     $Expected = new GenericContainer();
     $Expected->append($Email);
     $this->assertEquals(IDataMapper::UPDATED, $this->AddressHandler->addBCC($Email), 'IAddressHandler::addBCC() should return IDataMapper::UPDATED');
     $this->assertInstanceOf('\\BLW\\Type\\IContainer', $this->AddressHandler->getBCC(), 'IAddressHandler::getBCC() should return an instance of IContainer');
     $this->assertEquals($Expected, $this->AddressHandler->getBCC(), 'IAddressHandler::getBCC() returned an invalid IContainer');
 }
コード例 #2
0
ファイル: ATransport.php プロジェクト: mast3rpee/blw
 /**
  * Parse an instance of IMessage for receipients
  *
  * @param \BLW\Type\Mail\IMessage $Message
  *            Message to parse.
  * @return \BLW\Type\IContainer Parsed receipients.
  */
 public static function parseRecipients(IMessage $Message)
 {
     // Return value
     $Receipients = new GenericContainer(IMessage::EMAIL);
     // Add receipients 1 by 1
     $Iterator = array_merge(iterator_to_array($Message->To), iterator_to_array($Message->CC), iterator_to_array($Message->BCC));
     foreach ($Iterator as $Address) {
         if ($Address instanceof IEmailAddress) {
             $Receipients->append($Address);
         }
     }
     // Done
     return $Receipients;
 }
コード例 #3
0
ファイル: MessageTest.php プロジェクト: mast3rpee/blw
 /**
  * @depends test_InlineAttachment
  * @covers ::getInlineAttachments
  */
 public function test_getInlineAttachments()
 {
     $File = new GenericFile(self::FILE);
     $Expected = new GenericContainer();
     $Regex = '!\\x40[\\x30-\\x39\\x41-\\x5a\\x61\\x7a]+!';
     $Expected->append($File);
     $this->assertRegExp($Regex, $this->Message->inlineAttachment($File), 'IMessage::inlineAttachment() should return string of format `@[\\w]+');
     $this->assertInstanceOf('\\BLW\\Type\\IContainer', $this->Message->getInlineAttachments(), 'IMessage::getInlineAttachments() should return an instance of IContainer');
     $this->assertEquals($Expected, $this->Message->getInlineAttachments(), 'IMessage::getInlineAttachments() returned an invalid IContainer');
 }