Update composer dependencies
This commit is contained in:
6
vendor/swiftmailer/swiftmailer/.gitignore
vendored
6
vendor/swiftmailer/swiftmailer/.gitignore
vendored
@@ -1,4 +1,8 @@
|
||||
/.php_cs.cache
|
||||
/.phpunit
|
||||
/build/*
|
||||
/composer.lock
|
||||
/phpunit.xml
|
||||
/tests/acceptance.conf.php
|
||||
/tests/smoke.conf.php
|
||||
/build/*
|
||||
/vendor/
|
||||
|
||||
15
vendor/swiftmailer/swiftmailer/.php_cs.dist
vendored
Normal file
15
vendor/swiftmailer/swiftmailer/.php_cs.dist
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
return PhpCsFixer\Config::create()
|
||||
->setRules(array(
|
||||
'@Symfony' => true,
|
||||
'@Symfony:risky' => true,
|
||||
'array_syntax' => array('syntax' => 'long'),
|
||||
'no_unreachable_default_argument_value' => false,
|
||||
'braces' => array('allow_single_line_closure' => true),
|
||||
'heredoc_to_nowdoc' => false,
|
||||
'phpdoc_annotation_without_dot' => false,
|
||||
))
|
||||
->setRiskyAllowed(true)
|
||||
->setFinder(PhpCsFixer\Finder::create()->in(__DIR__))
|
||||
;
|
||||
8
vendor/swiftmailer/swiftmailer/.travis.yml
vendored
8
vendor/swiftmailer/swiftmailer/.travis.yml
vendored
@@ -11,8 +11,7 @@ before_script:
|
||||
- gem install mailcatcher
|
||||
- mailcatcher --smtp-port 4456
|
||||
|
||||
script:
|
||||
- phpunit --verbose
|
||||
script: ./vendor/bin/simple-phpunit
|
||||
|
||||
matrix:
|
||||
include:
|
||||
@@ -21,7 +20,12 @@ matrix:
|
||||
- php: 5.5
|
||||
- php: 5.6
|
||||
- php: 7.0
|
||||
- php: 7.1
|
||||
- php: hhvm
|
||||
allow_failures:
|
||||
- php: hhvm
|
||||
fast_finish: true
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- .phpunit
|
||||
|
||||
30
vendor/swiftmailer/swiftmailer/CHANGES
vendored
30
vendor/swiftmailer/swiftmailer/CHANGES
vendored
@@ -1,10 +1,36 @@
|
||||
Changelog
|
||||
=========
|
||||
|
||||
5.4.5 (2016-XX-XX)
|
||||
5.4.8 (2017-05-01)
|
||||
------------------
|
||||
|
||||
* fixed CVE-2016-10033 and CVE-2016-10045
|
||||
* fixed encoding inheritance in addPart()
|
||||
* fixed sorting MIME children when their types are equal
|
||||
|
||||
5.4.7 (2017-04-20)
|
||||
------------------
|
||||
|
||||
* fixed NTLMAuthenticator clobbering bcmath scale
|
||||
|
||||
5.4.6 (2017-02-13)
|
||||
------------------
|
||||
|
||||
* removed exceptions thrown in destructors as they lead to fatal errors
|
||||
* switched to use sha256 by default in DKIM as per the RFC
|
||||
* fixed an 'Undefined variable: pipes' PHP notice
|
||||
* fixed long To headers when using the mail transport
|
||||
* fixed NTLMAuthenticator when no domain is passed with the username
|
||||
* prevented fatal error during unserialization of a message
|
||||
* fixed a PHP warning when sending a message that has a length of a multiple of 8192
|
||||
|
||||
5.4.5 (2016-12-29)
|
||||
------------------
|
||||
|
||||
* SECURITY FIX: fixed CVE-2016-10074 by disallowing potentially unsafe shell characters
|
||||
|
||||
Prior to 5.4.5, the mail transport (Swift_Transport_MailTransport) was vulnerable to passing
|
||||
arbitrary shell arguments if the "From", "ReturnPath" or "Sender" header came
|
||||
from a non-trusted source, potentially allowing Remote Code Execution
|
||||
* deprecated the mail transport
|
||||
|
||||
5.4.4 (2016-11-23)
|
||||
|
||||
2
vendor/swiftmailer/swiftmailer/VERSION
vendored
2
vendor/swiftmailer/swiftmailer/VERSION
vendored
@@ -1 +1 @@
|
||||
Swift-5.4.5-DEV
|
||||
Swift-5.4.8
|
||||
|
||||
@@ -48,8 +48,8 @@ interface Swift_CharacterReader
|
||||
* A value of zero means this is already a valid character.
|
||||
* A value of -1 means this cannot possibly be a valid character.
|
||||
*
|
||||
* @param integer[] $bytes
|
||||
* @param int $size
|
||||
* @param int[] $bytes
|
||||
* @param int $size
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
|
||||
@@ -19,22 +19,22 @@ class Swift_CharacterReader_Utf8Reader implements Swift_CharacterReader
|
||||
/** Pre-computed for optimization */
|
||||
private static $length_map = array(
|
||||
// N=0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // 0x0N
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // 0x1N
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // 0x2N
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // 0x3N
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // 0x4N
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // 0x5N
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // 0x6N
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // 0x7N
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 0x8N
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 0x9N
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 0xAN
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 0xBN
|
||||
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, // 0xCN
|
||||
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, // 0xDN
|
||||
3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, // 0xEN
|
||||
4,4,4,4,4,4,4,4,5,5,5,5,6,6,0,0, // 0xFN
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x0N
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x1N
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x2N
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x3N
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x4N
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x5N
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x6N
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x7N
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x8N
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x9N
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0xAN
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0xBN
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xCN
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xDN
|
||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // 0xEN
|
||||
4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 0, 0, // 0xFN
|
||||
);
|
||||
|
||||
private static $s_length_map = array(
|
||||
|
||||
@@ -155,7 +155,7 @@ class Swift_CharacterStream_ArrayCharacterStream implements Swift_CharacterStrea
|
||||
*
|
||||
* @param int $length
|
||||
*
|
||||
* @return integer[]
|
||||
* @return int[]
|
||||
*/
|
||||
public function readBytes($length)
|
||||
{
|
||||
|
||||
@@ -48,7 +48,7 @@ class Swift_DependencyContainer
|
||||
/**
|
||||
* Returns a singleton of the DependencyContainer.
|
||||
*
|
||||
* @return Swift_DependencyContainer
|
||||
* @return self
|
||||
*/
|
||||
public static function getInstance()
|
||||
{
|
||||
@@ -143,7 +143,7 @@ class Swift_DependencyContainer
|
||||
*
|
||||
* @param string $itemName
|
||||
*
|
||||
* @return Swift_DependencyContainer
|
||||
* @return $this
|
||||
*/
|
||||
public function register($itemName)
|
||||
{
|
||||
@@ -160,7 +160,7 @@ class Swift_DependencyContainer
|
||||
*
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return Swift_DependencyContainer
|
||||
* @return $this
|
||||
*/
|
||||
public function asValue($value)
|
||||
{
|
||||
@@ -176,7 +176,7 @@ class Swift_DependencyContainer
|
||||
*
|
||||
* @param string $lookup
|
||||
*
|
||||
* @return Swift_DependencyContainer
|
||||
* @return $this
|
||||
*/
|
||||
public function asAliasOf($lookup)
|
||||
{
|
||||
@@ -198,7 +198,7 @@ class Swift_DependencyContainer
|
||||
*
|
||||
* @param string $className
|
||||
*
|
||||
* @return Swift_DependencyContainer
|
||||
* @return $this
|
||||
*/
|
||||
public function asNewInstanceOf($className)
|
||||
{
|
||||
@@ -216,7 +216,7 @@ class Swift_DependencyContainer
|
||||
*
|
||||
* @param string $className
|
||||
*
|
||||
* @return Swift_DependencyContainer
|
||||
* @return $this
|
||||
*/
|
||||
public function asSharedInstanceOf($className)
|
||||
{
|
||||
@@ -236,7 +236,7 @@ class Swift_DependencyContainer
|
||||
*
|
||||
* @param array $lookups
|
||||
*
|
||||
* @return Swift_DependencyContainer
|
||||
* @return $this
|
||||
*/
|
||||
public function withDependencies(array $lookups)
|
||||
{
|
||||
@@ -257,7 +257,7 @@ class Swift_DependencyContainer
|
||||
*
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return Swift_DependencyContainer
|
||||
* @return $this
|
||||
*/
|
||||
public function addConstructorValue($value)
|
||||
{
|
||||
@@ -278,7 +278,7 @@ class Swift_DependencyContainer
|
||||
*
|
||||
* @param string $lookup
|
||||
*
|
||||
* @return Swift_DependencyContainer
|
||||
* @return $this
|
||||
*/
|
||||
public function addConstructorLookup($lookup)
|
||||
{
|
||||
|
||||
@@ -235,8 +235,8 @@ class Swift_Encoder_QpEncoder implements Swift_Encoder
|
||||
/**
|
||||
* Encode the given byte array into a verbatim QP form.
|
||||
*
|
||||
* @param integer[] $bytes
|
||||
* @param int $size
|
||||
* @param int[] $bytes
|
||||
* @param int $size
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -262,7 +262,7 @@ class Swift_Encoder_QpEncoder implements Swift_Encoder
|
||||
*
|
||||
* @param int $size number of bytes to read
|
||||
*
|
||||
* @return integer[]
|
||||
* @return int[]
|
||||
*/
|
||||
protected function _nextSequence($size = 4)
|
||||
{
|
||||
|
||||
@@ -55,8 +55,6 @@ class Swift_Encoding
|
||||
return self::_lookup('mime.base64contentencoder');
|
||||
}
|
||||
|
||||
// -- Private Static Methods
|
||||
|
||||
private static function _lookup($key)
|
||||
{
|
||||
return Swift_DependencyContainer::getInstance()->lookup($key);
|
||||
|
||||
@@ -25,7 +25,7 @@ class Swift_Events_CommandEvent extends Swift_Events_EventObject
|
||||
/**
|
||||
* An array of codes which a successful response will contain.
|
||||
*
|
||||
* @var integer[]
|
||||
* @var int[]
|
||||
*/
|
||||
private $_successCodes = array();
|
||||
|
||||
@@ -56,7 +56,7 @@ class Swift_Events_CommandEvent extends Swift_Events_EventObject
|
||||
/**
|
||||
* Get the numeric response codes which indicate success for this command.
|
||||
*
|
||||
* @return integer[]
|
||||
* @return int[]
|
||||
*/
|
||||
public function getSuccessCodes()
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ class Swift_FailoverTransport extends Swift_Transport_FailoverTransport
|
||||
*
|
||||
* @param Swift_Transport[] $transports
|
||||
*
|
||||
* @return Swift_FailoverTransport
|
||||
* @return self
|
||||
*/
|
||||
public static function newInstance($transports = array())
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ class Swift_Image extends Swift_EmbeddedFile
|
||||
* @param string $filename
|
||||
* @param string $contentType
|
||||
*
|
||||
* @return Swift_Image
|
||||
* @return self
|
||||
*/
|
||||
public static function newInstance($data = null, $filename = null, $contentType = null)
|
||||
{
|
||||
@@ -48,14 +48,10 @@ class Swift_Image extends Swift_EmbeddedFile
|
||||
*
|
||||
* @param string $path
|
||||
*
|
||||
* @return Swift_Image
|
||||
* @return self
|
||||
*/
|
||||
public static function fromPath($path)
|
||||
{
|
||||
$image = self::newInstance()->setFile(
|
||||
new Swift_ByteStream_FileByteStream($path)
|
||||
);
|
||||
|
||||
return $image;
|
||||
return self::newInstance()->setFile(new Swift_ByteStream_FileByteStream($path));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ class Swift_LoadBalancedTransport extends Swift_Transport_LoadBalancedTransport
|
||||
*
|
||||
* @param array $transports
|
||||
*
|
||||
* @return Swift_LoadBalancedTransport
|
||||
* @return self
|
||||
*/
|
||||
public static function newInstance($transports = array())
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ class Swift_MailTransport extends Swift_Transport_MailTransport
|
||||
*
|
||||
* @param string $extraParams To be passed to mail()
|
||||
*
|
||||
* @return Swift_MailTransport
|
||||
* @return self
|
||||
*/
|
||||
public static function newInstance($extraParams = '-f%s')
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ class Swift_Mailer
|
||||
*
|
||||
* @param Swift_Transport $transport
|
||||
*
|
||||
* @return Swift_Mailer
|
||||
* @return self
|
||||
*/
|
||||
public static function newInstance(Swift_Transport $transport)
|
||||
{
|
||||
|
||||
@@ -86,9 +86,7 @@ class Swift_Message extends Swift_Mime_SimpleMessage
|
||||
*/
|
||||
public function addPart($body, $contentType = null, $charset = null)
|
||||
{
|
||||
return $this->attach(Swift_MimePart::newInstance(
|
||||
$body, $contentType, $charset
|
||||
));
|
||||
return $this->attach(Swift_MimePart::newInstance($body, $contentType, $charset)->setEncoder($this->getEncoder()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -64,7 +64,7 @@ class Swift_Mime_Attachment extends Swift_Mime_SimpleMimeEntity
|
||||
*
|
||||
* @param string $disposition
|
||||
*
|
||||
* @return Swift_Mime_Attachment
|
||||
* @return $this
|
||||
*/
|
||||
public function setDisposition($disposition)
|
||||
{
|
||||
@@ -90,7 +90,7 @@ class Swift_Mime_Attachment extends Swift_Mime_SimpleMimeEntity
|
||||
*
|
||||
* @param string $filename
|
||||
*
|
||||
* @return Swift_Mime_Attachment
|
||||
* @return $this
|
||||
*/
|
||||
public function setFilename($filename)
|
||||
{
|
||||
@@ -115,7 +115,7 @@ class Swift_Mime_Attachment extends Swift_Mime_SimpleMimeEntity
|
||||
*
|
||||
* @param int $size
|
||||
*
|
||||
* @return Swift_Mime_Attachment
|
||||
* @return $this
|
||||
*/
|
||||
public function setSize($size)
|
||||
{
|
||||
@@ -130,7 +130,7 @@ class Swift_Mime_Attachment extends Swift_Mime_SimpleMimeEntity
|
||||
* @param Swift_FileStream $file
|
||||
* @param string $contentType optional
|
||||
*
|
||||
* @return Swift_Mime_Attachment
|
||||
* @return $this
|
||||
*/
|
||||
public function setFile(Swift_FileStream $file, $contentType = null)
|
||||
{
|
||||
|
||||
@@ -138,7 +138,7 @@ interface Swift_Mime_HeaderSet extends Swift_Mime_CharsetObserver
|
||||
/**
|
||||
* Create a new instance of this HeaderSet.
|
||||
*
|
||||
* @return Swift_Mime_HeaderSet
|
||||
* @return self
|
||||
*/
|
||||
public function newInstance();
|
||||
|
||||
|
||||
@@ -219,8 +219,6 @@ abstract class Swift_Mime_Headers_AbstractHeader implements Swift_Mime_Header
|
||||
return $this->toString();
|
||||
}
|
||||
|
||||
// -- Points of extension
|
||||
|
||||
/**
|
||||
* Set the name of this Header field.
|
||||
*
|
||||
@@ -449,7 +447,7 @@ abstract class Swift_Mime_Headers_AbstractHeader implements Swift_Mime_Header
|
||||
*/
|
||||
protected function toTokens($string = null)
|
||||
{
|
||||
if (is_null($string)) {
|
||||
if (null === $string) {
|
||||
$string = $this->getFieldBody();
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ class Swift_Mime_Headers_DateHeader extends Swift_Mime_Headers_AbstractHeader
|
||||
*/
|
||||
public function setTimestamp($timestamp)
|
||||
{
|
||||
if (!is_null($timestamp)) {
|
||||
if (null !== $timestamp) {
|
||||
$timestamp = (int) $timestamp;
|
||||
}
|
||||
$this->clearCachedValueIf($this->_timestamp != $timestamp);
|
||||
|
||||
@@ -231,15 +231,13 @@ class Swift_Mime_Headers_MailboxHeader extends Swift_Mime_Headers_AbstractHeader
|
||||
public function getFieldBody()
|
||||
{
|
||||
// Compute the string value of the header only if needed
|
||||
if (is_null($this->getCachedValue())) {
|
||||
if (null === $this->getCachedValue()) {
|
||||
$this->setCachedValue($this->createMailboxListString($this->_mailboxes));
|
||||
}
|
||||
|
||||
return $this->getCachedValue();
|
||||
}
|
||||
|
||||
// -- Points of extension
|
||||
|
||||
/**
|
||||
* Normalizes a user-input list of mailboxes into consistent key=>value pairs.
|
||||
*
|
||||
@@ -323,7 +321,7 @@ class Swift_Mime_Headers_MailboxHeader extends Swift_Mime_Headers_AbstractHeader
|
||||
|
||||
foreach ($mailboxes as $email => $name) {
|
||||
$mailboxStr = $email;
|
||||
if (!is_null($name)) {
|
||||
if (null !== $name) {
|
||||
$nameStr = $this->createDisplayNameString($name, empty($strings));
|
||||
$mailboxStr = $nameStr.' <'.$mailboxStr.'>';
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ class Swift_Mime_Headers_ParameterizedHeader extends Swift_Mime_Headers_Unstruct
|
||||
{
|
||||
$body = parent::getFieldBody();
|
||||
foreach ($this->_params as $name => $value) {
|
||||
if (!is_null($value)) {
|
||||
if (null !== $value) {
|
||||
// Add the parameter
|
||||
$body .= '; '.$this->_createParameter($name, $value);
|
||||
}
|
||||
@@ -156,7 +156,7 @@ class Swift_Mime_Headers_ParameterizedHeader extends Swift_Mime_Headers_Unstruct
|
||||
|
||||
// Try creating any parameters
|
||||
foreach ($this->_params as $name => $value) {
|
||||
if (!is_null($value)) {
|
||||
if (null !== $value) {
|
||||
// Add the semi-colon separator
|
||||
$tokens[count($tokens) - 1] .= ';';
|
||||
$tokens = array_merge($tokens, $this->generateTokenLines(
|
||||
|
||||
@@ -80,7 +80,7 @@ class Swift_Mime_Headers_PathHeader extends Swift_Mime_Headers_AbstractHeader
|
||||
*/
|
||||
public function setAddress($address)
|
||||
{
|
||||
if (is_null($address)) {
|
||||
if (null === $address) {
|
||||
$this->_address = null;
|
||||
} elseif ('' == $address) {
|
||||
$this->_address = '';
|
||||
|
||||
@@ -40,7 +40,7 @@ class Swift_Mime_MimePart extends Swift_Mime_SimpleMimeEntity
|
||||
{
|
||||
parent::__construct($headers, $encoder, $cache, $grammar);
|
||||
$this->setContentType('text/plain');
|
||||
if (!is_null($charset)) {
|
||||
if (null !== $charset) {
|
||||
$this->setCharset($charset);
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,7 @@ class Swift_Mime_MimePart extends Swift_Mime_SimpleMimeEntity
|
||||
* @param string $contentType optional
|
||||
* @param string $charset optional
|
||||
*
|
||||
* @return Swift_Mime_MimePart
|
||||
* @return $this
|
||||
*/
|
||||
public function setBody($body, $contentType = null, $charset = null)
|
||||
{
|
||||
@@ -82,7 +82,7 @@ class Swift_Mime_MimePart extends Swift_Mime_SimpleMimeEntity
|
||||
*
|
||||
* @param string $charset
|
||||
*
|
||||
* @return Swift_Mime_MimePart
|
||||
* @return $this
|
||||
*/
|
||||
public function setCharset($charset)
|
||||
{
|
||||
@@ -111,7 +111,7 @@ class Swift_Mime_MimePart extends Swift_Mime_SimpleMimeEntity
|
||||
*
|
||||
* @param string $format
|
||||
*
|
||||
* @return Swift_Mime_MimePart
|
||||
* @return $this
|
||||
*/
|
||||
public function setFormat($format)
|
||||
{
|
||||
@@ -136,7 +136,7 @@ class Swift_Mime_MimePart extends Swift_Mime_SimpleMimeEntity
|
||||
*
|
||||
* @param bool $delsp
|
||||
*
|
||||
* @return Swift_Mime_MimePart
|
||||
* @return $this
|
||||
*/
|
||||
public function setDelSp($delsp = true)
|
||||
{
|
||||
|
||||
@@ -266,7 +266,7 @@ class Swift_Mime_SimpleHeaderSet implements Swift_Mime_HeaderSet
|
||||
/**
|
||||
* Create a new instance of this HeaderSet.
|
||||
*
|
||||
* @return Swift_Mime_HeaderSet
|
||||
* @return self
|
||||
*/
|
||||
public function newInstance()
|
||||
{
|
||||
|
||||
@@ -786,30 +786,33 @@ class Swift_Mime_SimpleMimeEntity implements Swift_Mime_MimeEntity
|
||||
|
||||
// Sort in order of preference, if there is one
|
||||
if ($shouldSort) {
|
||||
usort($this->_immediateChildren, array($this, '_childSortAlgorithm'));
|
||||
// Group the messages by order of preference
|
||||
$sorted = array();
|
||||
foreach ($this->_immediateChildren as $child) {
|
||||
$type = $child->getContentType();
|
||||
$level = array_key_exists($type, $this->_alternativePartOrder) ? $this->_alternativePartOrder[$type] : max($this->_alternativePartOrder) + 1;
|
||||
|
||||
if (empty($sorted[$level])) {
|
||||
$sorted[$level] = array();
|
||||
}
|
||||
|
||||
$sorted[$level][] = $child;
|
||||
}
|
||||
|
||||
ksort($sorted);
|
||||
|
||||
$this->_immediateChildren = array_reduce($sorted, 'array_merge', array());
|
||||
}
|
||||
}
|
||||
|
||||
private function _childSortAlgorithm($a, $b)
|
||||
{
|
||||
$typePrefs = array();
|
||||
$types = array(strtolower($a->getContentType()), strtolower($b->getContentType()));
|
||||
|
||||
foreach ($types as $type) {
|
||||
$typePrefs[] = array_key_exists($type, $this->_alternativePartOrder) ? $this->_alternativePartOrder[$type] : max($this->_alternativePartOrder) + 1;
|
||||
}
|
||||
|
||||
return $typePrefs[0] >= $typePrefs[1] ? 1 : -1;
|
||||
}
|
||||
|
||||
// -- Destructor
|
||||
|
||||
/**
|
||||
* Empties it's own contents from the cache.
|
||||
*/
|
||||
public function __destruct()
|
||||
{
|
||||
$this->_cache->clearAll($this->_cacheKey);
|
||||
if ($this->_cache instanceof Swift_KeyCache) {
|
||||
$this->_cache->clearAll($this->_cacheKey);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -50,7 +50,7 @@ class Swift_MimePart extends Swift_Mime_MimePart
|
||||
* @param string $contentType
|
||||
* @param string $charset
|
||||
*
|
||||
* @return Swift_Mime_MimePart
|
||||
* @return self
|
||||
*/
|
||||
public static function newInstance($body = null, $contentType = null, $charset = null)
|
||||
{
|
||||
|
||||
@@ -15,9 +15,6 @@
|
||||
*/
|
||||
class Swift_NullTransport extends Swift_Transport_NullTransport
|
||||
{
|
||||
/**
|
||||
* Create a new NullTransport.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
call_user_func_array(
|
||||
@@ -30,7 +27,7 @@ class Swift_NullTransport extends Swift_Transport_NullTransport
|
||||
/**
|
||||
* Create a new NullTransport instance.
|
||||
*
|
||||
* @return Swift_NullTransport
|
||||
* @return self
|
||||
*/
|
||||
public static function newInstance()
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ class Swift_Plugins_ImpersonatePlugin implements Swift_Events_SendListener
|
||||
/**
|
||||
* The sender to impersonate.
|
||||
*
|
||||
* @var String
|
||||
* @var string
|
||||
*/
|
||||
private $_sender;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
class Swift_Plugins_MessageLogger implements Swift_Events_SendListener
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
* @var Swift_Mime_Message[]
|
||||
*/
|
||||
private $messages;
|
||||
|
||||
@@ -28,7 +28,7 @@ class Swift_Plugins_MessageLogger implements Swift_Events_SendListener
|
||||
/**
|
||||
* Get the message list.
|
||||
*
|
||||
* @return array
|
||||
* @return Swift_Mime_Message[]
|
||||
*/
|
||||
public function getMessages()
|
||||
{
|
||||
|
||||
@@ -63,7 +63,7 @@ class Swift_Plugins_PopBeforeSmtpPlugin implements Swift_Events_TransportChangeL
|
||||
* @param int $port
|
||||
* @param string $crypto as "tls" or "ssl"
|
||||
*
|
||||
* @return Swift_Plugins_PopBeforeSmtpPlugin
|
||||
* @return self
|
||||
*/
|
||||
public static function newInstance($host, $port = 110, $crypto = null)
|
||||
{
|
||||
@@ -75,7 +75,7 @@ class Swift_Plugins_PopBeforeSmtpPlugin implements Swift_Events_TransportChangeL
|
||||
*
|
||||
* @param Swift_Plugins_Pop_Pop3Connection $connection
|
||||
*
|
||||
* @return Swift_Plugins_PopBeforeSmtpPlugin
|
||||
* @return $this
|
||||
*/
|
||||
public function setConnection(Swift_Plugins_Pop_Pop3Connection $connection)
|
||||
{
|
||||
@@ -99,7 +99,7 @@ class Swift_Plugins_PopBeforeSmtpPlugin implements Swift_Events_TransportChangeL
|
||||
*
|
||||
* @param int $timeout
|
||||
*
|
||||
* @return Swift_Plugins_PopBeforeSmtpPlugin
|
||||
* @return $this
|
||||
*/
|
||||
public function setTimeout($timeout)
|
||||
{
|
||||
@@ -113,7 +113,7 @@ class Swift_Plugins_PopBeforeSmtpPlugin implements Swift_Events_TransportChangeL
|
||||
*
|
||||
* @param string $username
|
||||
*
|
||||
* @return Swift_Plugins_PopBeforeSmtpPlugin
|
||||
* @return $this
|
||||
*/
|
||||
public function setUsername($username)
|
||||
{
|
||||
@@ -127,7 +127,7 @@ class Swift_Plugins_PopBeforeSmtpPlugin implements Swift_Events_TransportChangeL
|
||||
*
|
||||
* @param string $password
|
||||
*
|
||||
* @return Swift_Plugins_PopBeforeSmtpPlugin
|
||||
* @return $this
|
||||
*/
|
||||
public function setPassword($password)
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@ class Swift_Preferences
|
||||
/**
|
||||
* Gets the instance of Preferences.
|
||||
*
|
||||
* @return Swift_Preferences
|
||||
* @return self
|
||||
*/
|
||||
public static function getInstance()
|
||||
{
|
||||
@@ -42,12 +42,11 @@ class Swift_Preferences
|
||||
*
|
||||
* @param string $charset
|
||||
*
|
||||
* @return Swift_Preferences
|
||||
* @return $this
|
||||
*/
|
||||
public function setCharset($charset)
|
||||
{
|
||||
Swift_DependencyContainer::getInstance()
|
||||
->register('properties.charset')->asValue($charset);
|
||||
Swift_DependencyContainer::getInstance()->register('properties.charset')->asValue($charset);
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -57,12 +56,11 @@ class Swift_Preferences
|
||||
*
|
||||
* @param string $dir
|
||||
*
|
||||
* @return Swift_Preferences
|
||||
* @return $this
|
||||
*/
|
||||
public function setTempDir($dir)
|
||||
{
|
||||
Swift_DependencyContainer::getInstance()
|
||||
->register('tempdir')->asValue($dir);
|
||||
Swift_DependencyContainer::getInstance()->register('tempdir')->asValue($dir);
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -72,12 +70,11 @@ class Swift_Preferences
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return Swift_Preferences
|
||||
* @return $this
|
||||
*/
|
||||
public function setCacheType($type)
|
||||
{
|
||||
Swift_DependencyContainer::getInstance()
|
||||
->register('cache')->asAliasOf(sprintf('cache.%s', $type));
|
||||
Swift_DependencyContainer::getInstance()->register('cache')->asAliasOf(sprintf('cache.%s', $type));
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -87,7 +84,7 @@ class Swift_Preferences
|
||||
*
|
||||
* @param bool $dotEscape
|
||||
*
|
||||
* @return Swift_Preferences
|
||||
* @return $this
|
||||
*/
|
||||
public function setQPDotEscape($dotEscape)
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ class Swift_SendmailTransport extends Swift_Transport_SendmailTransport
|
||||
*
|
||||
* @param string $command
|
||||
*
|
||||
* @return Swift_SendmailTransport
|
||||
* @return self
|
||||
*/
|
||||
public static function newInstance($command = '/usr/sbin/sendmail -bs')
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ interface Swift_Signers_BodySigner extends Swift_Signer
|
||||
*
|
||||
* @param Swift_Message $message
|
||||
*
|
||||
* @return Swift_Signers_BodySigner
|
||||
* @return self
|
||||
*/
|
||||
public function signMessage(Swift_Message $message);
|
||||
|
||||
|
||||
@@ -39,9 +39,11 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner
|
||||
/**
|
||||
* Hash algorithm used.
|
||||
*
|
||||
* @see RFC6376 3.3: Signers MUST implement and SHOULD sign using rsa-sha256.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_hashAlgorithm = 'rsa-sha1';
|
||||
protected $_hashAlgorithm = 'rsa-sha256';
|
||||
|
||||
/**
|
||||
* Body canon method.
|
||||
@@ -101,7 +103,7 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner
|
||||
|
||||
/**
|
||||
* When will the signature expires false means not embedded, if sigTimestamp is auto
|
||||
* Expiration is relative, otherwhise it's absolute.
|
||||
* Expiration is relative, otherwise it's absolute.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
@@ -123,7 +125,7 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner
|
||||
protected $_signedHeaders = array();
|
||||
|
||||
/**
|
||||
* If debugHeaders is set store debugDatas here.
|
||||
* If debugHeaders is set store debugData here.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
@@ -174,6 +176,11 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner
|
||||
$this->_domainName = $domainName;
|
||||
$this->_signerIdentity = '@'.$domainName;
|
||||
$this->_selector = $selector;
|
||||
|
||||
// keep fallback hash algorithm sha1 if php version is lower than 5.4.8
|
||||
if (PHP_VERSION_ID < 50408) {
|
||||
$this->_hashAlgorithm = 'rsa-sha1';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -183,7 +190,7 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner
|
||||
* @param string $domainName
|
||||
* @param string $selector
|
||||
*
|
||||
* @return Swift_Signers_DKIMSigner
|
||||
* @return self
|
||||
*/
|
||||
public static function newInstance($privateKey, $domainName, $selector)
|
||||
{
|
||||
@@ -223,6 +230,7 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
// TODO fix return
|
||||
public function write($bytes)
|
||||
{
|
||||
$this->_canonicalizeBody($bytes);
|
||||
@@ -234,8 +242,6 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner
|
||||
/**
|
||||
* For any bytes that are currently buffered inside the stream, force them
|
||||
* off the buffer.
|
||||
*
|
||||
* @throws Swift_IoException
|
||||
*/
|
||||
public function commit()
|
||||
{
|
||||
@@ -276,8 +282,6 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -292,19 +296,28 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner
|
||||
}
|
||||
|
||||
/**
|
||||
* Set hash_algorithm, must be one of rsa-sha256 | rsa-sha1 defaults to rsa-sha256.
|
||||
* Set hash_algorithm, must be one of rsa-sha256 | rsa-sha1.
|
||||
*
|
||||
* @param string $hash
|
||||
* @param string $hash 'rsa-sha1' or 'rsa-sha256'
|
||||
*
|
||||
* @return Swift_Signers_DKIMSigner
|
||||
* @throws Swift_SwiftException
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setHashAlgorithm($hash)
|
||||
{
|
||||
// Unable to sign with rsa-sha256
|
||||
if ($hash == 'rsa-sha1') {
|
||||
$this->_hashAlgorithm = 'rsa-sha1';
|
||||
} else {
|
||||
$this->_hashAlgorithm = 'rsa-sha256';
|
||||
switch ($hash) {
|
||||
case 'rsa-sha1':
|
||||
$this->_hashAlgorithm = 'rsa-sha1';
|
||||
break;
|
||||
case 'rsa-sha256':
|
||||
$this->_hashAlgorithm = 'rsa-sha256';
|
||||
if (!defined('OPENSSL_ALGO_SHA256')) {
|
||||
throw new Swift_SwiftException('Unable to set sha256 as it is not supported by OpenSSL.');
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new Swift_SwiftException('Unable to set the hash algorithm, must be one of rsa-sha1 or rsa-sha256 (%s given).', $hash);
|
||||
}
|
||||
|
||||
return $this;
|
||||
@@ -315,7 +328,7 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner
|
||||
*
|
||||
* @param string $canon
|
||||
*
|
||||
* @return Swift_Signers_DKIMSigner
|
||||
* @return $this
|
||||
*/
|
||||
public function setBodyCanon($canon)
|
||||
{
|
||||
@@ -333,7 +346,7 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner
|
||||
*
|
||||
* @param string $canon
|
||||
*
|
||||
* @return Swift_Signers_DKIMSigner
|
||||
* @return $this
|
||||
*/
|
||||
public function setHeaderCanon($canon)
|
||||
{
|
||||
@@ -351,7 +364,7 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner
|
||||
*
|
||||
* @param string $identity
|
||||
*
|
||||
* @return Swift_Signers_DKIMSigner
|
||||
* @return $this
|
||||
*/
|
||||
public function setSignerIdentity($identity)
|
||||
{
|
||||
@@ -365,7 +378,7 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner
|
||||
*
|
||||
* @param mixed $len (bool or int)
|
||||
*
|
||||
* @return Swift_Signers_DKIMSigner
|
||||
* @return $this
|
||||
*/
|
||||
public function setBodySignedLen($len)
|
||||
{
|
||||
@@ -388,7 +401,7 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner
|
||||
*
|
||||
* @param int $time A timestamp
|
||||
*
|
||||
* @return Swift_Signers_DKIMSigner
|
||||
* @return $this
|
||||
*/
|
||||
public function setSignatureTimestamp($time)
|
||||
{
|
||||
@@ -402,7 +415,7 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner
|
||||
*
|
||||
* @param int $time A timestamp
|
||||
*
|
||||
* @return Swift_Signers_DKIMSigner
|
||||
* @return $this
|
||||
*/
|
||||
public function setSignatureExpiration($time)
|
||||
{
|
||||
@@ -583,7 +596,7 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner
|
||||
/**
|
||||
* @deprecated This method is currently useless in this class but it must be
|
||||
* kept for BC reasons due to its "protected" scope. This method
|
||||
* might be overriden by custom client code.
|
||||
* might be overridden by custom client code.
|
||||
*/
|
||||
protected function _endOfHeaders()
|
||||
{
|
||||
@@ -678,6 +691,7 @@ class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner
|
||||
private function _getEncryptedHash()
|
||||
{
|
||||
$signature = '';
|
||||
|
||||
switch ($this->_hashAlgorithm) {
|
||||
case 'rsa-sha1':
|
||||
$algorithm = OPENSSL_ALGO_SHA1;
|
||||
|
||||
@@ -131,7 +131,7 @@ class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner
|
||||
* @param string $domainName
|
||||
* @param string $selector
|
||||
*
|
||||
* @return Swift_Signers_DomainKeySigner
|
||||
* @return self
|
||||
*/
|
||||
public static function newInstance($privateKey, $domainName, $selector)
|
||||
{
|
||||
@@ -141,7 +141,7 @@ class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner
|
||||
/**
|
||||
* Resets internal states.
|
||||
*
|
||||
* @return Swift_Signers_DomainKeySigner
|
||||
* @return $this
|
||||
*/
|
||||
public function reset()
|
||||
{
|
||||
@@ -169,8 +169,7 @@ class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner
|
||||
*
|
||||
* @throws Swift_IoException
|
||||
*
|
||||
* @return int
|
||||
* @return Swift_Signers_DomainKeySigner
|
||||
* @return $this
|
||||
*/
|
||||
public function write($bytes)
|
||||
{
|
||||
@@ -188,7 +187,7 @@ class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner
|
||||
*
|
||||
* @throws Swift_IoException
|
||||
*
|
||||
* @return Swift_Signers_DomainKeySigner
|
||||
* @return $this
|
||||
*/
|
||||
public function commit()
|
||||
{
|
||||
@@ -203,7 +202,7 @@ class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner
|
||||
*
|
||||
* @param Swift_InputByteStream $is
|
||||
*
|
||||
* @return Swift_Signers_DomainKeySigner
|
||||
* @return $this
|
||||
*/
|
||||
public function bind(Swift_InputByteStream $is)
|
||||
{
|
||||
@@ -221,7 +220,7 @@ class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner
|
||||
*
|
||||
* @param Swift_InputByteStream $is
|
||||
*
|
||||
* @return Swift_Signers_DomainKeySigner
|
||||
* @return $this
|
||||
*/
|
||||
public function unbind(Swift_InputByteStream $is)
|
||||
{
|
||||
@@ -230,7 +229,7 @@ class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner
|
||||
if ($stream === $is) {
|
||||
unset($this->_bound[$k]);
|
||||
|
||||
return;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,7 +242,7 @@ class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner
|
||||
*
|
||||
* @throws Swift_IoException
|
||||
*
|
||||
* @return Swift_Signers_DomainKeySigner
|
||||
* @return $this
|
||||
*/
|
||||
public function flushBuffers()
|
||||
{
|
||||
@@ -257,7 +256,7 @@ class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner
|
||||
*
|
||||
* @param string $hash
|
||||
*
|
||||
* @return Swift_Signers_DomainKeySigner
|
||||
* @return $this
|
||||
*/
|
||||
public function setHashAlgorithm($hash)
|
||||
{
|
||||
@@ -271,7 +270,7 @@ class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner
|
||||
*
|
||||
* @param string $canon simple | nofws defaults to simple
|
||||
*
|
||||
* @return Swift_Signers_DomainKeySigner
|
||||
* @return $this
|
||||
*/
|
||||
public function setCanon($canon)
|
||||
{
|
||||
@@ -289,7 +288,7 @@ class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner
|
||||
*
|
||||
* @param string $identity
|
||||
*
|
||||
* @return Swift_Signers_DomainKeySigner
|
||||
* @return $this
|
||||
*/
|
||||
public function setSignerIdentity($identity)
|
||||
{
|
||||
@@ -303,7 +302,7 @@ class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner
|
||||
*
|
||||
* @param bool $debug
|
||||
*
|
||||
* @return Swift_Signers_DomainKeySigner
|
||||
* @return $this
|
||||
*/
|
||||
public function setDebugHeaders($debug)
|
||||
{
|
||||
@@ -346,7 +345,7 @@ class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner
|
||||
*
|
||||
* @param string $header_name
|
||||
*
|
||||
* @return Swift_Signers_DomainKeySigner
|
||||
* @return $this
|
||||
*/
|
||||
public function ignoreHeader($header_name)
|
||||
{
|
||||
@@ -360,7 +359,7 @@ class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner
|
||||
*
|
||||
* @param Swift_Mime_HeaderSet $headers
|
||||
*
|
||||
* @return Swift_Signers_DomainKeySigner
|
||||
* @return $this
|
||||
*/
|
||||
public function setHeaders(Swift_Mime_HeaderSet $headers)
|
||||
{
|
||||
@@ -392,7 +391,7 @@ class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner
|
||||
*
|
||||
* @param Swift_Mime_HeaderSet $headers
|
||||
*
|
||||
* @return Swift_Signers_DomainKeySigner
|
||||
* @return $this
|
||||
*/
|
||||
public function addSignature(Swift_Mime_HeaderSet $headers)
|
||||
{
|
||||
|
||||
@@ -20,21 +20,21 @@ interface Swift_Signers_HeaderSigner extends Swift_Signer, Swift_InputByteStream
|
||||
*
|
||||
* @param string $header_name
|
||||
*
|
||||
* @return Swift_Signers_HeaderSigner
|
||||
* @return self
|
||||
*/
|
||||
public function ignoreHeader($header_name);
|
||||
|
||||
/**
|
||||
* Prepare the Signer to get a new Body.
|
||||
*
|
||||
* @return Swift_Signers_HeaderSigner
|
||||
* @return self
|
||||
*/
|
||||
public function startBody();
|
||||
|
||||
/**
|
||||
* Give the signal that the body has finished streaming.
|
||||
*
|
||||
* @return Swift_Signers_HeaderSigner
|
||||
* @return self
|
||||
*/
|
||||
public function endBody();
|
||||
|
||||
@@ -43,7 +43,7 @@ interface Swift_Signers_HeaderSigner extends Swift_Signer, Swift_InputByteStream
|
||||
*
|
||||
* @param Swift_Mime_SimpleHeaderSet $headers
|
||||
*
|
||||
* @return Swift_Signers_HeaderSigner
|
||||
* @return self
|
||||
*/
|
||||
public function setHeaders(Swift_Mime_HeaderSet $headers);
|
||||
|
||||
@@ -52,7 +52,7 @@ interface Swift_Signers_HeaderSigner extends Swift_Signer, Swift_InputByteStream
|
||||
*
|
||||
* @param Swift_Mime_HeaderSet $headers
|
||||
*
|
||||
* @return Swift_Signers_HeaderSigner
|
||||
* @return self
|
||||
*/
|
||||
public function addSignature(Swift_Mime_HeaderSet $headers);
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ class Swift_Signers_OpenDKIMSigner extends Swift_Signers_DKIMSigner
|
||||
*
|
||||
* @param int $time
|
||||
*
|
||||
* @return Swift_Signers_DKIMSigner
|
||||
* @return $this
|
||||
*/
|
||||
public function setSignatureTimestamp($time)
|
||||
{
|
||||
@@ -147,7 +147,7 @@ class Swift_Signers_OpenDKIMSigner extends Swift_Signers_DKIMSigner
|
||||
*
|
||||
* @param int $time
|
||||
*
|
||||
* @return Swift_Signers_DKIMSigner
|
||||
* @return $this
|
||||
*/
|
||||
public function setSignatureExpiration($time)
|
||||
{
|
||||
@@ -161,7 +161,7 @@ class Swift_Signers_OpenDKIMSigner extends Swift_Signers_DKIMSigner
|
||||
*
|
||||
* @param bool $debug
|
||||
*
|
||||
* @return Swift_Signers_DKIMSigner
|
||||
* @return $this
|
||||
*/
|
||||
public function setDebugHeaders($debug)
|
||||
{
|
||||
|
||||
@@ -74,7 +74,7 @@ class Swift_Signers_SMimeSigner implements Swift_Signers_BodySigner
|
||||
* @param string $certificate
|
||||
* @param string $privateKey
|
||||
*
|
||||
* @return Swift_Signers_SMimeSigner
|
||||
* @return self
|
||||
*/
|
||||
public static function newInstance($certificate = null, $privateKey = null)
|
||||
{
|
||||
@@ -84,14 +84,14 @@ class Swift_Signers_SMimeSigner implements Swift_Signers_BodySigner
|
||||
/**
|
||||
* Set the certificate location to use for signing.
|
||||
*
|
||||
* @link http://www.php.net/manual/en/openssl.pkcs7.flags.php
|
||||
* @see http://www.php.net/manual/en/openssl.pkcs7.flags.php
|
||||
*
|
||||
* @param string $certificate
|
||||
* @param string|array $privateKey If the key needs an passphrase use array('file-location', 'passphrase') instead
|
||||
* @param int $signOptions Bitwise operator options for openssl_pkcs7_sign()
|
||||
* @param string $extraCerts A file containing intermediate certificates needed by the signing certificate
|
||||
*
|
||||
* @return Swift_Signers_SMimeSigner
|
||||
* @return $this
|
||||
*/
|
||||
public function setSignCertificate($certificate, $privateKey = null, $signOptions = PKCS7_DETACHED, $extraCerts = null)
|
||||
{
|
||||
@@ -117,13 +117,13 @@ class Swift_Signers_SMimeSigner implements Swift_Signers_BodySigner
|
||||
/**
|
||||
* Set the certificate location to use for encryption.
|
||||
*
|
||||
* @link http://www.php.net/manual/en/openssl.pkcs7.flags.php
|
||||
* @link http://nl3.php.net/manual/en/openssl.ciphers.php
|
||||
* @see http://www.php.net/manual/en/openssl.pkcs7.flags.php
|
||||
* @see http://nl3.php.net/manual/en/openssl.ciphers.php
|
||||
*
|
||||
* @param string|array $recipientCerts Either an single X.509 certificate, or an assoc array of X.509 certificates.
|
||||
* @param int $cipher
|
||||
*
|
||||
* @return Swift_Signers_SMimeSigner
|
||||
* @return $this
|
||||
*/
|
||||
public function setEncryptCertificate($recipientCerts, $cipher = null)
|
||||
{
|
||||
@@ -169,7 +169,7 @@ class Swift_Signers_SMimeSigner implements Swift_Signers_BodySigner
|
||||
*
|
||||
* @param bool $signThenEncrypt
|
||||
*
|
||||
* @return Swift_Signers_SMimeSigner
|
||||
* @return $this
|
||||
*/
|
||||
public function setSignThenEncrypt($signThenEncrypt = true)
|
||||
{
|
||||
@@ -189,7 +189,7 @@ class Swift_Signers_SMimeSigner implements Swift_Signers_BodySigner
|
||||
/**
|
||||
* Resets internal states.
|
||||
*
|
||||
* @return Swift_Signers_SMimeSigner
|
||||
* @return $this
|
||||
*/
|
||||
public function reset()
|
||||
{
|
||||
@@ -201,7 +201,7 @@ class Swift_Signers_SMimeSigner implements Swift_Signers_BodySigner
|
||||
*
|
||||
* @param Swift_Message $message
|
||||
*
|
||||
* @return Swift_Signers_SMimeSigner
|
||||
* @return $this
|
||||
*/
|
||||
public function signMessage(Swift_Message $message)
|
||||
{
|
||||
|
||||
@@ -49,7 +49,7 @@ class Swift_SmtpTransport extends Swift_Transport_EsmtpTransport
|
||||
* @param int $port
|
||||
* @param string $security
|
||||
*
|
||||
* @return Swift_SmtpTransport
|
||||
* @return self
|
||||
*/
|
||||
public static function newInstance($host = 'localhost', $port = 25, $security = null)
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ class Swift_SpoolTransport extends Swift_Transport_SpoolTransport
|
||||
*
|
||||
* @param Swift_Spool $spool
|
||||
*
|
||||
* @return Swift_SpoolTransport
|
||||
* @return self
|
||||
*/
|
||||
public static function newInstance(Swift_Spool $spool)
|
||||
{
|
||||
|
||||
@@ -131,7 +131,7 @@ class Swift_StreamFilters_ByteArrayReplacementFilter implements Swift_StreamFilt
|
||||
// We try to find if the next byte is part of a search pattern
|
||||
for ($j = 0; $j <= $this->_treeMaxLen; ++$j) {
|
||||
// We have a new byte for a search pattern
|
||||
if (isset($buffer [$p = $i + $j]) && isset($search_pos[$buffer[$p]])) {
|
||||
if (isset($buffer[$p = $i + $j]) && isset($search_pos[$buffer[$p]])) {
|
||||
$search_pos = $search_pos[$buffer[$p]];
|
||||
// We have a complete pattern, save, in case we don't find a better match later
|
||||
if (isset($search_pos[-1]) && $search_pos[-1] < $last_found
|
||||
|
||||
@@ -42,6 +42,10 @@ class Swift_StreamFilters_StringReplacementFilter implements Swift_StreamFilter
|
||||
*/
|
||||
public function shouldBuffer($buffer)
|
||||
{
|
||||
if ('' === $buffer) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$endOfBuffer = substr($buffer, -1);
|
||||
foreach ((array) $this->_search as $needle) {
|
||||
if (false !== strpos($needle, $endOfBuffer)) {
|
||||
|
||||
@@ -57,7 +57,7 @@ abstract class Swift_Transport_AbstractSmtpTransport implements Swift_Transport
|
||||
*
|
||||
* @param string $domain
|
||||
*
|
||||
* @return Swift_Transport_AbstractSmtpTransport
|
||||
* @return $this
|
||||
*/
|
||||
public function setLocalDomain($domain)
|
||||
{
|
||||
@@ -396,7 +396,7 @@ abstract class Swift_Transport_AbstractSmtpTransport implements Swift_Transport
|
||||
do {
|
||||
$line = $this->_buffer->readLine($seq);
|
||||
$response .= $line;
|
||||
} while (null !== $line && false !== $line && ' ' != $line{3});
|
||||
} while (null !== $line && false !== $line && ' ' != $line[3]);
|
||||
} catch (Swift_TransportException $e) {
|
||||
$this->_throwException($e);
|
||||
} catch (Swift_IoException $e) {
|
||||
@@ -491,6 +491,9 @@ abstract class Swift_Transport_AbstractSmtpTransport implements Swift_Transport
|
||||
*/
|
||||
public function __destruct()
|
||||
{
|
||||
$this->stop();
|
||||
try {
|
||||
$this->stop();
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,9 +296,14 @@ class Swift_Transport_Esmtp_Auth_NTLMAuthenticator implements Swift_Transport_Es
|
||||
return explode('\\', $name);
|
||||
}
|
||||
|
||||
list($user, $domain) = explode('@', $name);
|
||||
if (false !== strpos($name, '@')) {
|
||||
list($user, $domain) = explode('@', $name);
|
||||
|
||||
return array($domain, $user);
|
||||
return array($domain, $user);
|
||||
}
|
||||
|
||||
// no domain passed
|
||||
return array('', $name);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -361,11 +366,9 @@ class Swift_Transport_Esmtp_Auth_NTLMAuthenticator implements Swift_Transport_Es
|
||||
protected function getCorrectTimestamp($time)
|
||||
{
|
||||
// Get our timestamp (tricky!)
|
||||
bcscale(0);
|
||||
|
||||
$time = number_format($time, 0, '.', ''); // save microtime to string
|
||||
$time = bcadd($time, '11644473600000'); // add epoch time
|
||||
$time = bcmul($time, 10000); // tenths of a microsecond.
|
||||
$time = bcadd($time, '11644473600000', 0); // add epoch time
|
||||
$time = bcmul($time, 10000, 0); // tenths of a microsecond.
|
||||
|
||||
$binary = $this->si2bin($time, 64); // create 64 bit binary string
|
||||
$timestamp = '';
|
||||
@@ -459,6 +462,7 @@ class Swift_Transport_Esmtp_Auth_NTLMAuthenticator implements Swift_Transport_Es
|
||||
}
|
||||
|
||||
/** HELPER FUNCTIONS */
|
||||
|
||||
/**
|
||||
* Create our security buffer depending on length and offset.
|
||||
*
|
||||
@@ -561,6 +565,7 @@ class Swift_Transport_Esmtp_Auth_NTLMAuthenticator implements Swift_Transport_Es
|
||||
}
|
||||
|
||||
/** ENCRYPTION ALGORITHMS */
|
||||
|
||||
/**
|
||||
* DES Encryption.
|
||||
*
|
||||
|
||||
@@ -63,7 +63,7 @@ class Swift_Transport_EsmtpTransport extends Swift_Transport_AbstractSmtpTranspo
|
||||
*
|
||||
* @param string $host
|
||||
*
|
||||
* @return Swift_Transport_EsmtpTransport
|
||||
* @return $this
|
||||
*/
|
||||
public function setHost($host)
|
||||
{
|
||||
@@ -87,7 +87,7 @@ class Swift_Transport_EsmtpTransport extends Swift_Transport_AbstractSmtpTranspo
|
||||
*
|
||||
* @param int $port
|
||||
*
|
||||
* @return Swift_Transport_EsmtpTransport
|
||||
* @return $this
|
||||
*/
|
||||
public function setPort($port)
|
||||
{
|
||||
@@ -111,7 +111,7 @@ class Swift_Transport_EsmtpTransport extends Swift_Transport_AbstractSmtpTranspo
|
||||
*
|
||||
* @param int $timeout seconds
|
||||
*
|
||||
* @return Swift_Transport_EsmtpTransport
|
||||
* @return $this
|
||||
*/
|
||||
public function setTimeout($timeout)
|
||||
{
|
||||
@@ -136,7 +136,7 @@ class Swift_Transport_EsmtpTransport extends Swift_Transport_AbstractSmtpTranspo
|
||||
*
|
||||
* @param string $encryption
|
||||
*
|
||||
* @return Swift_Transport_EsmtpTransport
|
||||
* @return $this
|
||||
*/
|
||||
public function setEncryption($encryption)
|
||||
{
|
||||
@@ -167,7 +167,7 @@ class Swift_Transport_EsmtpTransport extends Swift_Transport_AbstractSmtpTranspo
|
||||
*
|
||||
* @param array $options
|
||||
*
|
||||
* @return Swift_Transport_EsmtpTransport
|
||||
* @return $this
|
||||
*/
|
||||
public function setStreamOptions($options)
|
||||
{
|
||||
@@ -191,7 +191,7 @@ class Swift_Transport_EsmtpTransport extends Swift_Transport_AbstractSmtpTranspo
|
||||
*
|
||||
* @param string $source
|
||||
*
|
||||
* @return Swift_Transport_EsmtpTransport
|
||||
* @return $this
|
||||
*/
|
||||
public function setSourceIp($source)
|
||||
{
|
||||
@@ -215,7 +215,7 @@ class Swift_Transport_EsmtpTransport extends Swift_Transport_AbstractSmtpTranspo
|
||||
*
|
||||
* @param Swift_Transport_EsmtpHandler[] $handlers
|
||||
*
|
||||
* @return Swift_Transport_EsmtpTransport
|
||||
* @return $this
|
||||
*/
|
||||
public function setExtensionHandlers(array $handlers)
|
||||
{
|
||||
@@ -270,8 +270,6 @@ class Swift_Transport_EsmtpTransport extends Swift_Transport_AbstractSmtpTranspo
|
||||
return parent::executeCommand($command, $codes, $failures);
|
||||
}
|
||||
|
||||
// -- Mixin invocation code
|
||||
|
||||
/** Mixin handling method for ESMTP handlers */
|
||||
public function __call($method, $args)
|
||||
{
|
||||
@@ -281,7 +279,7 @@ class Swift_Transport_EsmtpTransport extends Swift_Transport_AbstractSmtpTranspo
|
||||
)) {
|
||||
$return = call_user_func_array(array($handler, $method), $args);
|
||||
// Allow fluid method calls
|
||||
if (is_null($return) && substr($method, 0, 3) == 'set') {
|
||||
if (null === $return && substr($method, 0, 3) == 'set') {
|
||||
return $this;
|
||||
} else {
|
||||
return $return;
|
||||
|
||||
@@ -77,7 +77,7 @@ class Swift_Transport_MailTransport implements Swift_Transport
|
||||
*
|
||||
* @param string $params
|
||||
*
|
||||
* @return Swift_Transport_MailTransport
|
||||
* @return $this
|
||||
*/
|
||||
public function setExtraParams($params)
|
||||
{
|
||||
@@ -164,11 +164,13 @@ class Swift_Transport_MailTransport implements Swift_Transport
|
||||
$headers = str_replace("\r\n", PHP_EOL, $headers);
|
||||
$subject = str_replace("\r\n", PHP_EOL, $subject);
|
||||
$body = str_replace("\r\n", PHP_EOL, $body);
|
||||
$to = str_replace("\r\n", PHP_EOL, $to);
|
||||
} else {
|
||||
// Windows, using SMTP
|
||||
$headers = str_replace("\r\n.", "\r\n..", $headers);
|
||||
$subject = str_replace("\r\n.", "\r\n..", $subject);
|
||||
$body = str_replace("\r\n.", "\r\n..", $body);
|
||||
$to = str_replace("\r\n.", "\r\n..", $to);
|
||||
}
|
||||
|
||||
if ($this->_invoker->mail($to, $subject, $body, $headers, $this->_formatExtraParams($this->_extraParams, $reversePath))) {
|
||||
|
||||
@@ -64,7 +64,7 @@ class Swift_Transport_SendmailTransport extends Swift_Transport_AbstractSmtpTran
|
||||
*
|
||||
* @param string $command
|
||||
*
|
||||
* @return Swift_Transport_SendmailTransport
|
||||
* @return $this
|
||||
*/
|
||||
public function setCommand($command)
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ class Swift_Transport_SpoolTransport implements Swift_Transport
|
||||
*
|
||||
* @param Swift_Spool $spool
|
||||
*
|
||||
* @return Swift_Transport_SpoolTransport
|
||||
* @return $this
|
||||
*/
|
||||
public function setSpool(Swift_Spool $spool)
|
||||
{
|
||||
|
||||
@@ -84,7 +84,6 @@ class Swift_Transport_StreamBuffer extends Swift_ByteStream_AbstractFilterableIn
|
||||
if ($this->_stream) {
|
||||
stream_set_blocking($this->_stream, 1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$this->_params[$param] = $value;
|
||||
@@ -292,6 +291,7 @@ class Swift_Transport_StreamBuffer extends Swift_ByteStream_AbstractFilterableIn
|
||||
1 => array('pipe', 'w'),
|
||||
2 => array('pipe', 'w'),
|
||||
);
|
||||
$pipes = array();
|
||||
$this->_stream = proc_open($command, $descriptorSpec, $pipes);
|
||||
stream_set_blocking($pipes[2], 0);
|
||||
if ($err = stream_get_contents($pipes[2])) {
|
||||
|
||||
@@ -117,7 +117,7 @@ Swift_DependencyContainer::getInstance()
|
||||
// As of PHP 5.4.7, the quoted_printable_encode() function behaves correctly.
|
||||
// see https://github.com/php/php-src/commit/18bb426587d62f93c54c40bf8535eb8416603629
|
||||
->register('mime.qpcontentencoder')
|
||||
->asAliasOf(version_compare(phpversion(), '5.4.7', '>=') ? 'mime.qpcontentencoderproxy' : 'mime.safeqpcontentencoder')
|
||||
->asAliasOf(PHP_VERSION_ID >= 50407 ? 'mime.qpcontentencoderproxy' : 'mime.safeqpcontentencoder')
|
||||
;
|
||||
|
||||
unset($swift_mime_types);
|
||||
|
||||
@@ -20,6 +20,6 @@ if (@is_writable($tmpDir = sys_get_temp_dir())) {
|
||||
|
||||
// this should only be done when Swiftmailer won't use the native QP content encoder
|
||||
// see mime_deps.php
|
||||
if (version_compare(phpversion(), '5.4.7', '<')) {
|
||||
if (PHP_VERSION_ID < 50407) {
|
||||
$preferences->setQPDotEscape(false);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
class SwiftMailerSmokeTestCase extends SwiftMailerTestCase
|
||||
{
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
if (!defined('SWIFT_SMOKE_TRANSPORT_TYPE')) {
|
||||
$this->markTestSkipped(
|
||||
|
||||
@@ -12,13 +12,6 @@
|
||||
You can fill out only the parts you know and leave the other bits.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
Defines: The path to a writable directory (a temporary dir).
|
||||
Recommended: /tmp
|
||||
*/
|
||||
define('SWIFT_TMP_DIR', '/tmp');
|
||||
|
||||
/*
|
||||
Defines: The name and port of a SMTP server you can connect to.
|
||||
Recommended: smtp.gmail.com:25
|
||||
|
||||
@@ -2,24 +2,15 @@
|
||||
|
||||
class Swift_ByteStream_FileByteStreamAcceptanceTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
private $_tmpDir;
|
||||
private $_testFile;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
if (!defined('SWIFT_TMP_DIR')) {
|
||||
$this->markTestSkipped(
|
||||
'Cannot run test without a writable directory to use ('.
|
||||
'define SWIFT_TMP_DIR in tests/config.php if you wish to run this test)'
|
||||
);
|
||||
}
|
||||
|
||||
$this->_tmpDir = SWIFT_TMP_DIR;
|
||||
$this->_testFile = $this->_tmpDir.'/swift-test-file'.__CLASS__;
|
||||
$this->_testFile = sys_get_temp_dir().'/swift-test-file'.__CLASS__;
|
||||
file_put_contents($this->_testFile, 'abcdefghijklm');
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
protected function tearDown()
|
||||
{
|
||||
unlink($this->_testFile);
|
||||
}
|
||||
@@ -50,18 +41,14 @@ class Swift_ByteStream_FileByteStreamAcceptanceTest extends \PHPUnit_Framework_T
|
||||
|
||||
public function testFileCanBeWrittenTo()
|
||||
{
|
||||
$file = $this->_createFileStream(
|
||||
$this->_testFile, true
|
||||
);
|
||||
$file = $this->_createFileStream($this->_testFile, true);
|
||||
$file->write('foobar');
|
||||
$this->assertEquals('foobar', $file->read(8192));
|
||||
}
|
||||
|
||||
public function testReadingFromThenWritingToFile()
|
||||
{
|
||||
$file = $this->_createFileStream(
|
||||
$this->_testFile, true
|
||||
);
|
||||
$file = $this->_createFileStream($this->_testFile, true);
|
||||
$file->write('foobar');
|
||||
$this->assertEquals('foobar', $file->read(8192));
|
||||
$file->write('zipbutton');
|
||||
@@ -70,9 +57,7 @@ class Swift_ByteStream_FileByteStreamAcceptanceTest extends \PHPUnit_Framework_T
|
||||
|
||||
public function testWritingToFileWithCanonicalization()
|
||||
{
|
||||
$file = $this->_createFileStream(
|
||||
$this->_testFile, true
|
||||
);
|
||||
$file = $this->_createFileStream($this->_testFile, true);
|
||||
$file->addFilter($this->_createFilter(array("\r\n", "\r"), "\n"), 'allToLF');
|
||||
$file->write("foo\r\nbar\r");
|
||||
$file->write("\nzip\r\ntest\r");
|
||||
@@ -80,11 +65,18 @@ class Swift_ByteStream_FileByteStreamAcceptanceTest extends \PHPUnit_Framework_T
|
||||
$this->assertEquals("foo\nbar\nzip\ntest\n", file_get_contents($this->_testFile));
|
||||
}
|
||||
|
||||
public function testWritingWithFulleMessageLengthOfAMultipleOf8192()
|
||||
{
|
||||
$file = $this->_createFileStream($this->_testFile, true);
|
||||
$file->addFilter($this->_createFilter(array("\r\n", "\r"), "\n"), 'allToLF');
|
||||
$file->write('');
|
||||
$file->flushBuffers();
|
||||
$this->assertEquals('', file_get_contents($this->_testFile));
|
||||
}
|
||||
|
||||
public function testBindingOtherStreamsMirrorsWriteOperations()
|
||||
{
|
||||
$file = $this->_createFileStream(
|
||||
$this->_testFile, true
|
||||
);
|
||||
$file = $this->_createFileStream($this->_testFile, true);
|
||||
$is1 = $this->_createMockInputStream();
|
||||
$is2 = $this->_createMockInputStream();
|
||||
|
||||
@@ -129,9 +121,7 @@ class Swift_ByteStream_FileByteStreamAcceptanceTest extends \PHPUnit_Framework_T
|
||||
|
||||
public function testUnbindingStreamPreventsFurtherWrites()
|
||||
{
|
||||
$file = $this->_createFileStream(
|
||||
$this->_testFile, true
|
||||
);
|
||||
$file = $this->_createFileStream($this->_testFile, true);
|
||||
$is1 = $this->_createMockInputStream();
|
||||
$is2 = $this->_createMockInputStream();
|
||||
|
||||
@@ -155,8 +145,6 @@ class Swift_ByteStream_FileByteStreamAcceptanceTest extends \PHPUnit_Framework_T
|
||||
$file->write('y');
|
||||
}
|
||||
|
||||
// -- Creation methods
|
||||
|
||||
private function _createFilter($search, $replace)
|
||||
{
|
||||
return new Swift_StreamFilters_StringReplacementFilter($search, $replace);
|
||||
|
||||
@@ -5,7 +5,7 @@ class Swift_CharacterReaderFactory_SimpleCharacterReaderFactoryAcceptanceTest ex
|
||||
private $_factory;
|
||||
private $_prefix = 'Swift_CharacterReader_';
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->_factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory();
|
||||
}
|
||||
@@ -14,7 +14,7 @@ class Swift_CharacterReaderFactory_SimpleCharacterReaderFactoryAcceptanceTest ex
|
||||
{
|
||||
foreach (array('utf8', 'utf-8', 'UTF-8', 'UTF8') as $utf8) {
|
||||
$reader = $this->_factory->getReaderFor($utf8);
|
||||
$this->assertInstanceof($this->_prefix.'Utf8Reader', $reader);
|
||||
$this->assertInstanceOf($this->_prefix.'Utf8Reader', $reader);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class Swift_CharacterReaderFactory_SimpleCharacterReaderFactoryAcceptanceTest ex
|
||||
|
||||
foreach ($charsets as $charset) {
|
||||
$reader = $this->_factory->getReaderFor($charset);
|
||||
$this->assertInstanceof($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertEquals(1, $reader->getInitialByteSize());
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,7 @@ class Swift_CharacterReaderFactory_SimpleCharacterReaderFactoryAcceptanceTest ex
|
||||
|
||||
foreach ($charsets as $charset) {
|
||||
$reader = $this->_factory->getReaderFor($charset);
|
||||
$this->assertInstanceof($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertEquals(1, $reader->getInitialByteSize());
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@ class Swift_CharacterReaderFactory_SimpleCharacterReaderFactoryAcceptanceTest ex
|
||||
|
||||
foreach ($charsets as $charset) {
|
||||
$reader = $this->_factory->getReaderFor($charset);
|
||||
$this->assertInstanceof($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertEquals(1, $reader->getInitialByteSize());
|
||||
}
|
||||
}
|
||||
@@ -83,7 +83,7 @@ class Swift_CharacterReaderFactory_SimpleCharacterReaderFactoryAcceptanceTest ex
|
||||
{
|
||||
foreach (array('ansi', 'ANSI') as $ansi) {
|
||||
$reader = $this->_factory->getReaderFor($ansi);
|
||||
$this->assertInstanceof($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertEquals(1, $reader->getInitialByteSize());
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ class Swift_CharacterReaderFactory_SimpleCharacterReaderFactoryAcceptanceTest ex
|
||||
{
|
||||
foreach (array('macintosh', 'MACINTOSH') as $mac) {
|
||||
$reader = $this->_factory->getReaderFor($mac);
|
||||
$this->assertInstanceof($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertEquals(1, $reader->getInitialByteSize());
|
||||
}
|
||||
}
|
||||
@@ -109,7 +109,7 @@ class Swift_CharacterReaderFactory_SimpleCharacterReaderFactoryAcceptanceTest ex
|
||||
|
||||
foreach ($charsets as $charset) {
|
||||
$reader = $this->_factory->getReaderFor($charset);
|
||||
$this->assertInstanceof($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertEquals(1, $reader->getInitialByteSize());
|
||||
}
|
||||
}
|
||||
@@ -118,7 +118,7 @@ class Swift_CharacterReaderFactory_SimpleCharacterReaderFactoryAcceptanceTest ex
|
||||
{
|
||||
foreach (array('iscii', 'ISCII', 'viscii', 'VISCII') as $charset) {
|
||||
$reader = $this->_factory->getReaderFor($charset);
|
||||
$this->assertInstanceof($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertEquals(1, $reader->getInitialByteSize());
|
||||
}
|
||||
}
|
||||
@@ -127,7 +127,7 @@ class Swift_CharacterReaderFactory_SimpleCharacterReaderFactoryAcceptanceTest ex
|
||||
{
|
||||
foreach (array('mik', 'MIK') as $charset) {
|
||||
$reader = $this->_factory->getReaderFor($charset);
|
||||
$this->assertInstanceof($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertEquals(1, $reader->getInitialByteSize());
|
||||
}
|
||||
}
|
||||
@@ -136,7 +136,7 @@ class Swift_CharacterReaderFactory_SimpleCharacterReaderFactoryAcceptanceTest ex
|
||||
{
|
||||
foreach (array('cork', 'CORK', 't1', 'T1') as $charset) {
|
||||
$reader = $this->_factory->getReaderFor($charset);
|
||||
$this->assertInstanceof($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertEquals(1, $reader->getInitialByteSize());
|
||||
}
|
||||
}
|
||||
@@ -145,7 +145,7 @@ class Swift_CharacterReaderFactory_SimpleCharacterReaderFactoryAcceptanceTest ex
|
||||
{
|
||||
foreach (array('ucs-2', 'UCS-2', 'ucs2', 'UCS2') as $charset) {
|
||||
$reader = $this->_factory->getReaderFor($charset);
|
||||
$this->assertInstanceof($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertEquals(2, $reader->getInitialByteSize());
|
||||
}
|
||||
}
|
||||
@@ -154,7 +154,7 @@ class Swift_CharacterReaderFactory_SimpleCharacterReaderFactoryAcceptanceTest ex
|
||||
{
|
||||
foreach (array('utf-16', 'UTF-16', 'utf16', 'UTF16') as $charset) {
|
||||
$reader = $this->_factory->getReaderFor($charset);
|
||||
$this->assertInstanceof($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertEquals(2, $reader->getInitialByteSize());
|
||||
}
|
||||
}
|
||||
@@ -163,7 +163,7 @@ class Swift_CharacterReaderFactory_SimpleCharacterReaderFactoryAcceptanceTest ex
|
||||
{
|
||||
foreach (array('ucs-4', 'UCS-4', 'ucs4', 'UCS4') as $charset) {
|
||||
$reader = $this->_factory->getReaderFor($charset);
|
||||
$this->assertInstanceof($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertEquals(4, $reader->getInitialByteSize());
|
||||
}
|
||||
}
|
||||
@@ -172,7 +172,7 @@ class Swift_CharacterReaderFactory_SimpleCharacterReaderFactoryAcceptanceTest ex
|
||||
{
|
||||
foreach (array('utf-32', 'UTF-32', 'utf32', 'UTF32') as $charset) {
|
||||
$reader = $this->_factory->getReaderFor($charset);
|
||||
$this->assertInstanceof($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertInstanceOf($this->_prefix.'GenericFixedWidthReader', $reader);
|
||||
$this->assertEquals(4, $reader->getInitialByteSize());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ class Swift_Encoder_Base64EncoderAcceptanceTest extends \PHPUnit_Framework_TestC
|
||||
private $_samplesDir;
|
||||
private $_encoder;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->_samplesDir = realpath(__DIR__.'/../../../_samples/charsets');
|
||||
$this->_encoder = new Swift_Encoder_Base64Encoder();
|
||||
|
||||
@@ -5,7 +5,7 @@ class Swift_Encoder_QpEncoderAcceptanceTest extends \PHPUnit_Framework_TestCase
|
||||
private $_samplesDir;
|
||||
private $_factory;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->_samplesDir = realpath(__DIR__.'/../../../_samples/charsets');
|
||||
$this->_factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory();
|
||||
|
||||
@@ -5,7 +5,7 @@ class Swift_Encoder_Rfc2231EncoderAcceptanceTest extends \PHPUnit_Framework_Test
|
||||
private $_samplesDir;
|
||||
private $_factory;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->_samplesDir = realpath(__DIR__.'/../../../_samples/charsets');
|
||||
$this->_factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory();
|
||||
|
||||
@@ -6,7 +6,7 @@ class Swift_KeyCache_ArrayKeyCacheAcceptanceTest extends \PHPUnit_Framework_Test
|
||||
private $_key1 = 'key1';
|
||||
private $_key2 = 'key2';
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->_cache = new Swift_KeyCache_ArrayKeyCache(
|
||||
new Swift_KeyCache_SimpleKeyCacheInputStream()
|
||||
|
||||
@@ -6,21 +6,11 @@ class Swift_KeyCache_DiskKeyCacheAcceptanceTest extends \PHPUnit_Framework_TestC
|
||||
private $_key1;
|
||||
private $_key2;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
if (!defined('SWIFT_TMP_DIR')) {
|
||||
$this->markTestSkipped(
|
||||
'Cannot run test without a writable directory to use ('.
|
||||
'define SWIFT_TMP_DIR in tests/config.php if you wish to run this test)'
|
||||
);
|
||||
}
|
||||
|
||||
$this->_key1 = uniqid(microtime(true), true);
|
||||
$this->_key2 = uniqid(microtime(true), true);
|
||||
$this->_cache = new Swift_KeyCache_DiskKeyCache(
|
||||
new Swift_KeyCache_SimpleKeyCacheInputStream(),
|
||||
SWIFT_TMP_DIR
|
||||
);
|
||||
$this->_cache = new Swift_KeyCache_DiskKeyCache(new Swift_KeyCache_SimpleKeyCacheInputStream(), sys_get_temp_dir());
|
||||
}
|
||||
|
||||
public function testStringDataCanBeSetAndFetched()
|
||||
|
||||
@@ -45,8 +45,6 @@ class Swift_MessageAcceptanceTest extends Swift_Mime_SimpleMessageAcceptanceTest
|
||||
);
|
||||
}
|
||||
|
||||
// -- Private helpers
|
||||
|
||||
protected function _createMessage()
|
||||
{
|
||||
Swift_DependencyContainer::getInstance()
|
||||
|
||||
@@ -7,7 +7,7 @@ class Swift_Mime_AttachmentAcceptanceTest extends \PHPUnit_Framework_TestCase
|
||||
private $_grammar;
|
||||
private $_headers;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->_cache = new Swift_KeyCache_ArrayKeyCache(
|
||||
new Swift_KeyCache_SimpleKeyCacheInputStream()
|
||||
@@ -109,8 +109,6 @@ class Swift_Mime_AttachmentAcceptanceTest extends \PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
// -- Private helpers
|
||||
|
||||
protected function _createAttachment()
|
||||
{
|
||||
$entity = new Swift_Mime_Attachment(
|
||||
|
||||
@@ -5,7 +5,7 @@ class Swift_Mime_ContentEncoder_Base64ContentEncoderAcceptanceTest extends \PHPU
|
||||
private $_samplesDir;
|
||||
private $_encoder;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->_samplesDir = realpath(__DIR__.'/../../../../_samples/charsets');
|
||||
$this->_encoder = new Swift_Mime_ContentEncoder_Base64ContentEncoder();
|
||||
|
||||
@@ -9,7 +9,7 @@ class Swift_Mime_ContentEncoder_NativeQpContentEncoderAcceptanceTest extends \PH
|
||||
*/
|
||||
protected $_encoder;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->_samplesDir = realpath(__DIR__.'/../../../../_samples/charsets');
|
||||
$this->_encoder = new Swift_Mime_ContentEncoder_NativeQpContentEncoder();
|
||||
@@ -65,7 +65,7 @@ class Swift_Mime_ContentEncoder_NativeQpContentEncoderAcceptanceTest extends \PH
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException RuntimeException
|
||||
* @expectedException \RuntimeException
|
||||
*/
|
||||
public function testCharsetChangeNotImplemented()
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ class Swift_Mime_ContentEncoder_PlainContentEncoderAcceptanceTest extends \PHPUn
|
||||
private $_samplesDir;
|
||||
private $_encoder;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->_samplesDir = realpath(__DIR__.'/../../../../_samples/charsets');
|
||||
$this->_encoder = new Swift_Mime_ContentEncoder_PlainContentEncoder('8bit');
|
||||
|
||||
@@ -5,13 +5,13 @@ class Swift_Mime_ContentEncoder_QpContentEncoderAcceptanceTest extends \PHPUnit_
|
||||
private $_samplesDir;
|
||||
private $_factory;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->_samplesDir = realpath(__DIR__.'/../../../../_samples/charsets');
|
||||
$this->_factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
protected function tearDown()
|
||||
{
|
||||
Swift_Preferences::getInstance()->setQPDotEscape(false);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ class Swift_Mime_EmbeddedFileAcceptanceTest extends \PHPUnit_Framework_TestCase
|
||||
private $_grammar;
|
||||
private $_headers;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->_cache = new Swift_KeyCache_ArrayKeyCache(
|
||||
new Swift_KeyCache_SimpleKeyCacheInputStream()
|
||||
@@ -122,8 +122,6 @@ class Swift_Mime_EmbeddedFileAcceptanceTest extends \PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
// -- Private helpers
|
||||
|
||||
protected function _createEmbeddedFile()
|
||||
{
|
||||
$entity = new Swift_Mime_EmbeddedFile(
|
||||
|
||||
@@ -4,7 +4,7 @@ class Swift_Mime_HeaderEncoder_Base64HeaderEncoderAcceptanceTest extends \PHPUni
|
||||
{
|
||||
private $_encoder;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->_encoder = new Swift_Mime_HeaderEncoder_Base64HeaderEncoder();
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ class Swift_Mime_MimePartAcceptanceTest extends \PHPUnit_Framework_TestCase
|
||||
private $_grammar;
|
||||
private $_headers;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->_cache = new Swift_KeyCache_ArrayKeyCache(
|
||||
new Swift_KeyCache_SimpleKeyCacheInputStream()
|
||||
@@ -113,8 +113,6 @@ class Swift_Mime_MimePartAcceptanceTest extends \PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
// -- Private helpers
|
||||
|
||||
protected function _createMimePart()
|
||||
{
|
||||
$entity = new Swift_Mime_MimePart(
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
class Swift_Mime_SimpleMessageAcceptanceTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
Swift_Preferences::getInstance()->setCharset(null); //TODO: Test with the charset defined
|
||||
}
|
||||
@@ -1227,8 +1227,6 @@ class Swift_Mime_SimpleMessageAcceptanceTest extends \PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
// -- Private helpers
|
||||
|
||||
protected function _createMessage()
|
||||
{
|
||||
return new Swift_Message();
|
||||
|
||||
@@ -6,7 +6,7 @@ abstract class Swift_Transport_StreamBuffer_AbstractStreamBufferAcceptanceTest e
|
||||
|
||||
abstract protected function _initializeBuffer();
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
if (true == getenv('TRAVIS')) {
|
||||
$this->markTestSkipped(
|
||||
@@ -124,8 +124,6 @@ abstract class Swift_Transport_StreamBuffer_AbstractStreamBufferAcceptanceTest e
|
||||
$this->_buffer->write('y');
|
||||
}
|
||||
|
||||
// -- Creation Methods
|
||||
|
||||
private function _createMockInputStream()
|
||||
{
|
||||
return $this->getMockBuilder('Swift_InputByteStream')->getMock();
|
||||
|
||||
@@ -4,7 +4,7 @@ require_once __DIR__.'/AbstractStreamBufferAcceptanceTest.php';
|
||||
|
||||
class Swift_Transport_StreamBuffer_BasicSocketAcceptanceTest extends Swift_Transport_StreamBuffer_AbstractStreamBufferAcceptanceTest
|
||||
{
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
if (!defined('SWIFT_SMTP_HOST')) {
|
||||
$this->markTestSkipped(
|
||||
|
||||
@@ -4,7 +4,7 @@ require_once __DIR__.'/AbstractStreamBufferAcceptanceTest.php';
|
||||
|
||||
class Swift_Transport_StreamBuffer_ProcessAcceptanceTest extends Swift_Transport_StreamBuffer_AbstractStreamBufferAcceptanceTest
|
||||
{
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
if (!defined('SWIFT_SENDMAIL_PATH')) {
|
||||
$this->markTestSkipped(
|
||||
|
||||
@@ -8,7 +8,7 @@ class Swift_Transport_StreamBuffer_SocketTimeoutTest extends \PHPUnit_Framework_
|
||||
|
||||
protected $_server;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
if (!defined('SWIFT_SMTP_HOST')) {
|
||||
$this->markTestSkipped(
|
||||
@@ -54,11 +54,11 @@ class Swift_Transport_StreamBuffer_SocketTimeoutTest extends \PHPUnit_Framework_
|
||||
$line = $this->_buffer->readLine(0);
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
$this->assertInstanceof('Swift_IoException', $e, 'IO Exception Not Thrown On Connection Timeout');
|
||||
$this->assertInstanceOf('Swift_IoException', $e, 'IO Exception Not Thrown On Connection Timeout');
|
||||
$this->assertRegExp('/Connection to .* Timed Out/', $e->getMessage());
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
protected function tearDown()
|
||||
{
|
||||
if ($this->_server) {
|
||||
stream_socket_shutdown($this->_server, STREAM_SHUT_RDWR);
|
||||
|
||||
@@ -4,7 +4,7 @@ require_once __DIR__.'/AbstractStreamBufferAcceptanceTest.php';
|
||||
|
||||
class Swift_Transport_StreamBuffer_SslSocketAcceptanceTest extends Swift_Transport_StreamBuffer_AbstractStreamBufferAcceptanceTest
|
||||
{
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$streams = stream_get_transports();
|
||||
if (!in_array('ssl', $streams)) {
|
||||
|
||||
@@ -4,7 +4,7 @@ require_once __DIR__.'/AbstractStreamBufferAcceptanceTest.php';
|
||||
|
||||
class Swift_Transport_StreamBuffer_TlsSocketAcceptanceTest extends Swift_Transport_StreamBuffer_AbstractStreamBufferAcceptanceTest
|
||||
{
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$streams = stream_get_transports();
|
||||
if (!in_array('tls', $streams)) {
|
||||
|
||||
@@ -4,7 +4,7 @@ class Swift_Bug118Test extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
private $_message;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->_message = new Swift_Message();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ class Swift_Bug206Test extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
private $_factory;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory();
|
||||
$headerEncoder = new Swift_Mime_HeaderEncoder_QpHeaderEncoder(
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
class Swift_Bug34Test extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
Swift_Preferences::getInstance()->setCharset('utf-8');
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
class Swift_Bug35Test extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
Swift_Preferences::getInstance()->setCharset('utf-8');
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ class Swift_Bug38Test extends \PHPUnit_Framework_TestCase
|
||||
private $_attFileName;
|
||||
private $_attFileType;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->_attFileName = 'data.txt';
|
||||
$this->_attFileType = 'text/plain';
|
||||
@@ -181,8 +181,6 @@ class Swift_Bug38Test extends \PHPUnit_Framework_TestCase
|
||||
$this->assertPatternInStream($pattern, $streamB);
|
||||
}
|
||||
|
||||
// -- Helpers
|
||||
|
||||
public function assertPatternInStream($pattern, $stream, $message = '%s')
|
||||
{
|
||||
$string = '';
|
||||
|
||||
@@ -5,23 +5,16 @@ class Swift_Bug51Test extends \SwiftMailerTestCase
|
||||
private $_attachmentFile;
|
||||
private $_outputFile;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
if (!defined('SWIFT_TMP_DIR') || !is_writable(SWIFT_TMP_DIR)) {
|
||||
$this->markTestSkipped(
|
||||
'Cannot run test without a writable directory to use ('.
|
||||
'define SWIFT_TMP_DIR in tests/config.php if you wish to run this test)'
|
||||
);
|
||||
}
|
||||
|
||||
$this->_attachmentFile = SWIFT_TMP_DIR.'/attach.rand.bin';
|
||||
$this->_attachmentFile = sys_get_temp_dir().'/attach.rand.bin';
|
||||
file_put_contents($this->_attachmentFile, '');
|
||||
|
||||
$this->_outputFile = SWIFT_TMP_DIR.'/attach.out.bin';
|
||||
$this->_outputFile = sys_get_temp_dir().'/attach.out.bin';
|
||||
file_put_contents($this->_outputFile, '');
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
protected function tearDown()
|
||||
{
|
||||
unlink($this->_attachmentFile);
|
||||
unlink($this->_outputFile);
|
||||
@@ -66,8 +59,6 @@ class Swift_Bug51Test extends \SwiftMailerTestCase
|
||||
}
|
||||
}
|
||||
|
||||
// -- Custom Assertions
|
||||
|
||||
public function assertAttachmentFromSourceMatches($attachmentData, $source)
|
||||
{
|
||||
$encHeader = 'Content-Transfer-Encoding: base64';
|
||||
@@ -88,8 +79,6 @@ class Swift_Bug51Test extends \SwiftMailerTestCase
|
||||
$this->assertIdenticalBinary($attachmentData, base64_decode($attachmentBase64));
|
||||
}
|
||||
|
||||
// -- Creation Methods
|
||||
|
||||
private function _fillFileWithRandomBytes($byteCount, $file)
|
||||
{
|
||||
// I was going to use dd with if=/dev/random but this way seems more
|
||||
|
||||
@@ -4,7 +4,7 @@ class Swift_Bug71Test extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
private $_message;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->_message = new Swift_Message('test');
|
||||
}
|
||||
|
||||
@@ -6,25 +6,18 @@ class Swift_Bug76Test extends \PHPUnit_Framework_TestCase
|
||||
private $_outputFile;
|
||||
private $_encoder;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
if (!defined('SWIFT_TMP_DIR') || !is_writable(SWIFT_TMP_DIR)) {
|
||||
$this->markTestSkipped(
|
||||
'Cannot run test without a writable directory to use ('.
|
||||
'define SWIFT_TMP_DIR in tests/config.php if you wish to run this test)'
|
||||
);
|
||||
}
|
||||
|
||||
$this->_inputFile = SWIFT_TMP_DIR.'/in.bin';
|
||||
$this->_inputFile = sys_get_temp_dir().'/in.bin';
|
||||
file_put_contents($this->_inputFile, '');
|
||||
|
||||
$this->_outputFile = SWIFT_TMP_DIR.'/out.bin';
|
||||
$this->_outputFile = sys_get_temp_dir().'/out.bin';
|
||||
file_put_contents($this->_outputFile, '');
|
||||
|
||||
$this->_encoder = $this->_createEncoder();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
protected function tearDown()
|
||||
{
|
||||
unlink($this->_inputFile);
|
||||
unlink($this->_outputFile);
|
||||
@@ -44,8 +37,6 @@ class Swift_Bug76Test extends \PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
// -- Custom Assertions
|
||||
|
||||
public function assertMaxLineLength($length, $filePath, $message = '%s')
|
||||
{
|
||||
$lines = file($filePath);
|
||||
@@ -54,8 +45,6 @@ class Swift_Bug76Test extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
}
|
||||
|
||||
// -- Creation Methods
|
||||
|
||||
private function _fillFileWithRandomBytes($byteCount, $file)
|
||||
{
|
||||
// I was going to use dd with if=/dev/random but this way seems more
|
||||
|
||||
@@ -32,27 +32,35 @@ class MimeEntityFixture implements Swift_Mime_MimeEntity
|
||||
public function getId()
|
||||
{
|
||||
}
|
||||
|
||||
public function getHeaders()
|
||||
{
|
||||
}
|
||||
|
||||
public function getBody()
|
||||
{
|
||||
}
|
||||
|
||||
public function setBody($body, $contentType = null)
|
||||
{
|
||||
}
|
||||
|
||||
public function toByteStream(Swift_InputByteStream $is)
|
||||
{
|
||||
}
|
||||
|
||||
public function charsetChanged($charset)
|
||||
{
|
||||
}
|
||||
|
||||
public function encoderChanged(Swift_Mime_ContentEncoder $encoder)
|
||||
{
|
||||
}
|
||||
|
||||
public function getChildren()
|
||||
{
|
||||
}
|
||||
|
||||
public function setChildren(array $children)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ class Swift_Smoke_AttachmentSmokeTest extends SwiftMailerSmokeTestCase
|
||||
{
|
||||
private $_attFile;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setup(); // For skip
|
||||
$this->_attFile = __DIR__.'/../../../_samples/files/textfile.zip';
|
||||
|
||||
@@ -7,7 +7,7 @@ class Swift_Smoke_HtmlWithAttachmentSmokeTest extends SwiftMailerSmokeTestCase
|
||||
{
|
||||
private $_attFile;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->_attFile = __DIR__.'/../../../_samples/files/textfile.zip';
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ class Swift_Smoke_InternationalSmokeTest extends SwiftMailerSmokeTestCase
|
||||
{
|
||||
private $_attFile;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setup(); // For skip
|
||||
$this->_attFile = __DIR__.'/../../../_samples/files/textfile.zip';
|
||||
|
||||
@@ -194,8 +194,6 @@ class Swift_ByteStream_ArrayByteStreamTest extends \PHPUnit_Framework_TestCase
|
||||
$bs->write('y');
|
||||
}
|
||||
|
||||
// -- Creation Methods
|
||||
|
||||
private function _createArrayStream($input)
|
||||
{
|
||||
return new Swift_ByteStream_ArrayByteStream($input);
|
||||
|
||||
@@ -18,7 +18,7 @@ class Swift_CharacterReader_UsAsciiReaderTest extends \PHPUnit_Framework_TestCas
|
||||
|
||||
private $_reader;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->_reader = new Swift_CharacterReader_UsAsciiReader();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ class Swift_CharacterReader_Utf8ReaderTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
private $_reader;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->_reader = new Swift_CharacterReader_Utf8Reader();
|
||||
}
|
||||
|
||||
@@ -335,8 +335,6 @@ class Swift_CharacterStream_ArrayCharacterStreamTest extends \SwiftMailerTestCas
|
||||
$this->assertFalse($stream->read(1));
|
||||
}
|
||||
|
||||
// -- Creation methods
|
||||
|
||||
private function _getReader()
|
||||
{
|
||||
return $this->getMockery('Swift_CharacterReader');
|
||||
|
||||
@@ -4,6 +4,7 @@ class One
|
||||
{
|
||||
public $arg1;
|
||||
public $arg2;
|
||||
|
||||
public function __construct($arg1 = null, $arg2 = null)
|
||||
{
|
||||
$this->arg1 = $arg1;
|
||||
@@ -15,7 +16,7 @@ class Swift_DependencyContainerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
private $_container;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->_container = new Swift_DependencyContainer();
|
||||
}
|
||||
@@ -40,7 +41,7 @@ class Swift_DependencyContainerTest extends \PHPUnit_Framework_TestCase
|
||||
public function testRegisterAndLookupNewInstance()
|
||||
{
|
||||
$this->_container->register('one')->asNewInstanceOf('One');
|
||||
$this->assertInstanceof('One', $this->_container->lookup('one'));
|
||||
$this->assertInstanceOf('One', $this->_container->lookup('one'));
|
||||
}
|
||||
|
||||
public function testHasReturnsTrueForRegisteredInstance()
|
||||
@@ -60,7 +61,7 @@ class Swift_DependencyContainerTest extends \PHPUnit_Framework_TestCase
|
||||
public function testRegisterAndLookupSharedInstance()
|
||||
{
|
||||
$this->_container->register('one')->asSharedInstanceOf('One');
|
||||
$this->assertInstanceof('One', $this->_container->lookup('one'));
|
||||
$this->assertInstanceOf('One', $this->_container->lookup('one'));
|
||||
}
|
||||
|
||||
public function testHasReturnsTrueForSharedInstance()
|
||||
|
||||
@@ -4,7 +4,7 @@ class Swift_Encoder_Base64EncoderTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
private $_encoder;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp()
|
||||
{
|
||||
$this->_encoder = new Swift_Encoder_Base64Encoder();
|
||||
}
|
||||
|
||||
@@ -385,8 +385,6 @@ class Swift_Encoder_QpEncoderTest extends \SwiftMailerTestCase
|
||||
);
|
||||
}
|
||||
|
||||
// -- Creation methods
|
||||
|
||||
private function _createCharStream()
|
||||
{
|
||||
return $this->getMockery('Swift_CharacterStream')->shouldIgnoreMissing();
|
||||
|
||||
@@ -22,8 +22,6 @@ class Swift_Events_CommandEventTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($transport, $ref);
|
||||
}
|
||||
|
||||
// -- Creation Methods
|
||||
|
||||
private function _createEvent(Swift_Transport $source, $command, $successCodes = array())
|
||||
{
|
||||
return new Swift_Events_CommandEvent($source, $command, $successCodes);
|
||||
|
||||
@@ -25,8 +25,6 @@ class Swift_Events_EventObjectTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($evt->bubbleCancelled());
|
||||
}
|
||||
|
||||
// -- Creation Methods
|
||||
|
||||
private function _createEvent($source)
|
||||
{
|
||||
return new Swift_Events_EventObject($source);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user