TYPO3 CMS  TYPO3_6-2
SwiftMailerAdapterTest.php
Go to the documentation of this file.
1 <?php
3 
23 
27  protected $fixture;
28 
29  public function setUp() {
30  $this->fixture = $this->getAccessibleMock('\\TYPO3\\CMS\\Core\\Mail\\SwiftMailerAdapter', array('dummy'));
31  }
32 
34  // Tests concerning mail
36 
41  static public function parseAddressesProvider() {
42  return array(
43  'name &ltemail&gt;' => array('name <email@example.org>', array('email@example.org' => 'name')),
44  '&lt;email&gt;' => array('<email@example.org>', array('email@example.org')),
45  'email' => array('email@example.org', array('email@example.org')),
46  'email1,email2' => array('email1@example.org,email2@example.com', array('email1@example.org', 'email2@example.com')),
47  'name &ltemail&gt;,email2' => array('name <email1@example.org>,email2@example.com', array('email1@example.org' => 'name', 'email2@example.com')),
48  '"last, first" &lt;name@example.org&gt;' => array('"last, first" <email@example.org>', array('email@example.org' => '"last, first"')),
49  'email,name &ltemail&gt;,"last, first" &lt;name@example.org&gt;' => array(
50  'email1@example.org, name <email2@example.org>, "last, first" <email3@example.org>',
51  array(
52  'email1@example.org',
53  'email2@example.org' => 'name',
54  'email3@example.org' => '"last, first"'
55  )
56  )
57  );
58  }
59 
64  public function parseAddressesTest($source, $addressList) {
65  $this->assertEquals($addressList, $this->fixture->_callRef('parseAddresses', $source));
66  }
67 
68 }
getAccessibleMock( $originalClassName, array $methods=array(), array $arguments=array(), $mockClassName='', $callOriginalConstructor=TRUE, $callOriginalClone=TRUE, $callAutoload=TRUE)