Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 30 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,46 @@ cache:

env:
global:
- SERVICE_MANAGER_VERSION="^3.0.3"
- COMPOSER_ARGS="--no-interaction"
- COVERAGE_DEPS="satooshi/php-coveralls"
- LEGACY_DEPS="phpunit/phpunit"
- SITE_URL: https://zendframework.github.io/zend-mail
- GH_USER_NAME: "Matthew Weier O'Phinney"
- GH_USER_EMAIL: matthew@weierophinney.net
- GH_REF: github.com/zendframework/zend-mail.git
- secure: "D/LfNRozbXUjssR19Yi+6luLML1XyVhTLaky2FPlFAuWb80viVzTxhlvX1QgWPSxxTH8zLRlPm/71E8wYHTN94UGLwJorOthA/btaWKPtdgJtlHXErSgofVVOUqAObvGFOW9sSSuRZ5gFN0c47uuWJmYbiI3HUQkFMjpGpFatXO1SajzK+dCpN4cuhgHW3T41PNbiG8RRCYeFwGBJdpIXEm3HYN6bAWRbFnnu4uCVnQYZnDn/Rprr8+WIU5JFOJQ7ttCQuq1RMP3EC1fVIr0N5gFL91KYX9EyCYmLpZNMS6kF9cPTRQbMEOcKMXqqfGA031MlhvveeOiVWiap/ScMwpId0ugTq9O+sUvBHZuk4FSRtiURcPTLKAmQfUie8Zb+/dxKI18oOWVLsUU919wAEU/hGeTOvATl0WcjqZ2LmxOLVm6UE8+5kM1FhM04XjQaFSJVWK+Asto9KRrOSd310SMpluATutO2ZSN0r7+a7S65M38RRh63NOtdrtbbYIx7+MdAmfPwH5+wr3gekD0pDgnfQd1zLQNWMF/2idTjoxO6xAxTLvthThf5ANXadz1A2Dwqn1EdGsTJ2QItGO7TFwDE+Wfi1O6vtm2FgEy98vwC0t4D1op+0QSRMPr6lFkzINOv4aVO/SB1NF3zwiB95ZsvqReU/Zj2+aDzltf5tY="

matrix:
fast_finish: true
include:
- php: 5.5
env:
- CS_CHECK=true
- php: 5.5
- php: 5.6
env:
- SERVICE_MANAGER_VERSION="^2.7.5"
- DEPS=lowest
- php: 5.6
env:
- DEPS=latest
- TEST_COVERAGE=true
- CS_CHECK=true
- DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)"
- PATH="$HOME/.local/bin:$PATH"
- php: 5.6
env:
- SERVICE_MANAGER_VERSION="^2.7.5"
- php: 7
env:
- DEPS=lowest
- php: 7
env:
- SERVICE_MANAGER_VERSION="^2.7.5"
- php: hhvm
- php: hhvm
- DEPS=latest
- php: 7.1
env:
- DEPS=lowest
- php: 7.1
env:
- DEPS=latest
- php: hhvm
env:
- DEPS=lowest
- php: hhvm
env:
- SERVICE_MANAGER_VERSION="^2.7.5"
- DEPS=latest
allow_failures:
- php: hhvm

Expand All @@ -55,13 +64,16 @@ notifications:
email: false

before_install:
- if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
- composer self-update
- if [[ $TEST_COVERAGE == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls ; fi
- composer require --dev --no-update "zendframework/zend-servicemanager:$SERVICE_MANAGER_VERSION"
- travis_retry composer self-update
- if [[ $TRAVIS_PHP_VERSION != "hhvm" && $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini ; fi

install:
- travis_retry composer install --no-interaction --ignore-platform-reqs
- travis_retry composer install $COMPOSER_ARGS
- if [[ $TRAVIS_PHP_VERSION =~ ^5.6 ]]; then travis_retry composer update $COMPOSER_ARGS --with-dependencies $LEGACY_DEPS ; fi
- if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi
- if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi
- composer show

script:
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ All notable changes to this project will be documented in this file, in reverse
configuration flag and/or the `setuseCompleteQuit($flag)` method to change
the setting (default is to enable this behavior, which was the previous
behavior).

- [#128](https://github.com/zendframework/zend-mail/pull/128) adds a
requirement on ext/iconv, as it is used internally.
- [#132](https://github.com/zendframework/zend-mail/pull/132) bumps minimum
php version to 5.6

### Deprecated

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
}
},
"require": {
"php": "^5.5 || ^7.0",
"php": "^7.0 || ^5.6",
"ext-iconv": "*",
"zendframework/zend-loader": "^2.5",
"zendframework/zend-mime": "^2.5",
Expand All @@ -24,7 +24,7 @@
"zendframework/zend-config": "^2.6",
"zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3",
"zendframework/zend-crypt": "^2.6",
"phpunit/phpunit": "^4.8",
"phpunit/phpunit": "^6.0.8 || ^5.7.15",
"zendframework/zend-coding-standard": "~1.0.0"
},
"suggest": {
Expand Down
3 changes: 2 additions & 1 deletion test/AddressListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@

namespace ZendTest\Mail;

use PHPUnit\Framework\TestCase;
use Zend\Mail\Address;
use Zend\Mail\AddressList;

/**
* @group Zend_Mail
* @covers Zend\Mail\AddressList<extended>
*/
class AddressListTest extends \PHPUnit_Framework_TestCase
class AddressListTest extends TestCase
{
public function setUp()
{
Expand Down
5 changes: 3 additions & 2 deletions test/AddressTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@

namespace ZendTest\Mail;

use PHPUnit\Framework\TestCase;
use Zend\Mail\Address;

/**
* @covers Zend\Mail\Address<extended>
*/
class AddressTest extends \PHPUnit_Framework_TestCase
class AddressTest extends TestCase
{
public function testDoesNotRequireNameForInstantiation()
{
Expand Down Expand Up @@ -44,7 +45,7 @@ public function testToStringCreatesStringRepresentation()
*/
public function testSetAddressInvalidAddressObject($email, $name)
{
$this->setExpectedException('Zend\Mail\Exception\InvalidArgumentException');
$this->expectException('Zend\Mail\Exception\InvalidArgumentException');
new Address($email, $name);
}

Expand Down
3 changes: 2 additions & 1 deletion test/Header/AddressListHeaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace ZendTest\Mail\Header;

use PHPUnit\Framework\TestCase;
use Zend\Mail\Address;
use Zend\Mail\AddressList;
use Zend\Mail\Header\Bcc;
Expand All @@ -20,7 +21,7 @@
/**
* @group Zend_Mail
*/
class AddressListHeaderTest extends \PHPUnit_Framework_TestCase
class AddressListHeaderTest extends TestCase
{
public static function getHeaderInstances()
{
Expand Down
16 changes: 9 additions & 7 deletions test/Header/ContentTransferEncodingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@

namespace ZendTest\Mail\Header;

use PHPUnit\Framework\TestCase;
use Zend\Mail\Header\ContentTransferEncoding;

/**
* @group Zend_Mail
* @covers Zend\Mail\Header\ContentTransferEncoding<extended>
*/
class ContentTransferEncodingTest extends \PHPUnit_Framework_TestCase
class ContentTransferEncodingTest extends TestCase
{
public function dataValidEncodings()
{
Expand Down Expand Up @@ -50,7 +51,7 @@ public function testContentTransferEncodingFromStringCreatesValidContentTransfer
*/
public function testContentTransferEncodingFromStringRaisesException($encoding)
{
$this->setExpectedException('Zend\Mail\Header\Exception\InvalidArgumentException');
$this->expectException('Zend\Mail\Header\Exception\InvalidArgumentException');
$contentTransferEncodingHeader = ContentTransferEncoding::fromString('Content-Transfer-Encoding: '.$encoding);
}

Expand Down Expand Up @@ -104,7 +105,7 @@ public function testProvidingParametersIntroducesHeaderFolding()
*/
public function testFromStringRaisesExceptionOnInvalidHeaderName()
{
$this->setExpectedException('Zend\Mail\Header\Exception\InvalidArgumentException');
$this->expectException('Zend\Mail\Header\Exception\InvalidArgumentException');
ContentTransferEncoding::fromString('Content-Transfer-Encoding' . chr(32) . ': 8bit');
}

Expand All @@ -120,11 +121,10 @@ public function headerLines()
/**
* @dataProvider headerLines
* @group ZF2015-04
* @expectedException Zend\Mail\Header\Exception\InvalidArgumentException
*/
public function testFromStringRaisesExceptionForInvalidMultilineValues($headerLine)
{
$this->setExpectedException('Zend\Mail\Header\Exception\InvalidArgumentException');
$this->expectException('Zend\Mail\Header\Exception\InvalidArgumentException');
ContentTransferEncoding::fromString($headerLine);
}

Expand All @@ -133,7 +133,8 @@ public function testFromStringRaisesExceptionForInvalidMultilineValues($headerLi
*/
public function testFromStringRaisesExceptionForContinuations()
{
$this->setExpectedException('Zend\Mail\Header\Exception\InvalidArgumentException', 'expects');
$this->expectException('Zend\Mail\Header\Exception\InvalidArgumentException');
$this->expectExceptionMessage('expects');
ContentTransferEncoding::fromString("Content-Transfer-Encoding: 8bit\r\n 7bit");
}

Expand All @@ -143,7 +144,8 @@ public function testFromStringRaisesExceptionForContinuations()
public function testSetTransferEncodingRaisesExceptionForInvalidValues()
{
$header = new ContentTransferEncoding();
$this->setExpectedException('Zend\Mail\Header\Exception\InvalidArgumentException', 'expects');
$this->expectException('Zend\Mail\Header\Exception\InvalidArgumentException');
$this->expectExceptionMessage('expects');
$header->setTransferEncoding("8bit\r\n 7bit");
}
}
9 changes: 6 additions & 3 deletions test/Header/ContentTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace ZendTest\Mail\Header;

use PHPUnit\Framework\TestCase;
use Zend\Mail\Header\ContentType;
use Zend\Mail\Header\Exception\InvalidArgumentException;
use Zend\Mail\Header\HeaderInterface;
Expand All @@ -18,7 +19,7 @@
* @group Zend_Mail
* @covers Zend\Mail\Header\ContentType<extended>
*/
class ContentTypeTest extends \PHPUnit_Framework_TestCase
class ContentTypeTest extends TestCase
{
public function testImplementsHeaderInterface()
{
Expand Down Expand Up @@ -85,7 +86,8 @@ public function testSetType($type, $parameters, $fieldValue, $expectedToString)
*/
public function testFromStringThrowException($headerLine, $expectedException, $exceptionMessage)
{
$this->setExpectedException($expectedException, $exceptionMessage);
$this->expectException($expectedException);
$this->expectExceptionMessage($exceptionMessage);
ContentType::fromString($headerLine);
}

Expand All @@ -107,7 +109,8 @@ public function testAddParameterThrowException($paramName, $paramValue, $expecte
$header = new ContentType();
$header->setType('text/html');

$this->setExpectedException($expectedException, $exceptionMessage);
$this->expectException($expectedException);
$this->expectExceptionMessage($exceptionMessage);
$header->addParameter($paramName, $paramValue);
}

Expand Down
6 changes: 3 additions & 3 deletions test/Header/DateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace ZendTest\Mail\Header;

use PHPUnit_Framework_TestCase as TestCase;
use PHPUnit\Framework\TestCase;
use Zend\Mail\Header;

/**
Expand All @@ -33,7 +33,7 @@ public function headerLines()
*/
public function testFromStringRaisesExceptionOnCrlfInjectionAttempt($header)
{
$this->setExpectedException('Zend\Mail\Header\Exception\InvalidArgumentException');
$this->expectException('Zend\Mail\Header\Exception\InvalidArgumentException');
Header\Date::fromString($header);
}

Expand All @@ -42,7 +42,7 @@ public function testFromStringRaisesExceptionOnCrlfInjectionAttempt($header)
*/
public function testPreventsCRLFInjectionViaConstructor()
{
$this->setExpectedException('Zend\Mail\Header\Exception\InvalidArgumentException');
$this->expectException('Zend\Mail\Header\Exception\InvalidArgumentException');
$address = new Header\Date("This\ris\r\na\nCRLF Attack");
}
}
7 changes: 4 additions & 3 deletions test/Header/GenericHeaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace ZendTest\Mail\Header;

use PHPUnit_Framework_TestCase as TestCase;
use PHPUnit\Framework\TestCase;
use Zend\Mail\Header\GenericHeader;

/**
Expand All @@ -22,7 +22,7 @@ class GenericHeaderTest extends TestCase
*/
public function testSplitHeaderLineRaisesExceptionOnInvalidHeader()
{
$this->setExpectedException('Zend\Mail\Header\Exception\InvalidArgumentException');
$this->expectException('Zend\Mail\Header\Exception\InvalidArgumentException');
GenericHeader::splitHeaderLine(
'Content-Type' . chr(32) . ': text/html; charset = "iso-8859-1"' . "\nThis is a test"
);
Expand All @@ -43,7 +43,8 @@ public function fieldNames()
public function testRaisesExceptionOnInvalidFieldName($fieldName)
{
$header = new GenericHeader();
$this->setExpectedException('Zend\Mail\Header\Exception\InvalidArgumentException', 'name');
$this->expectException('Zend\Mail\Header\Exception\InvalidArgumentException');
$this->expectExceptionMessage('name');
$header->setFieldName($fieldName);
}

Expand Down
5 changes: 3 additions & 2 deletions test/Header/HeaderNameTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace ZendTest\Mail\Header;

use PHPUnit_Framework_TestCase as TestCase;
use PHPUnit\Framework\TestCase;
use Zend\Mail\Header\HeaderName;

/**
Expand Down Expand Up @@ -80,7 +80,8 @@ public function assertNames()
*/
public function testAssertValidRaisesExceptionForInvalidNames($name)
{
$this->setExpectedException('Zend\Mail\Header\Exception\RuntimeException', 'Invalid');
$this->expectException('Zend\Mail\Header\Exception\RuntimeException');
$this->expectExceptionMessage('Invalid');
HeaderName::assertValid($name);
}
}
5 changes: 3 additions & 2 deletions test/Header/HeaderValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace ZendTest\Mail\Header;

use PHPUnit_Framework_TestCase as TestCase;
use PHPUnit\Framework\TestCase;
use ReflectionClass;
use Zend\Mail\Header\HeaderValue;

Expand Down Expand Up @@ -101,7 +101,8 @@ public function assertValues()
*/
public function testAssertValidRaisesExceptionForInvalidValues($value)
{
$this->setExpectedException('Zend\Mail\Header\Exception\RuntimeException', 'Invalid');
$this->expectException('Zend\Mail\Header\Exception\RuntimeException');
$this->expectExceptionMessage('Invalid');
HeaderValue::assertValid($value);
}
}
7 changes: 4 additions & 3 deletions test/Header/HeaderWrapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@

namespace ZendTest\Mail\Header;

use PHPUnit\Framework\TestCase;
use Zend\Mail\Header\GenericHeader;
use Zend\Mail\Header\HeaderWrap;

/**
* @group Zend_Mail
* @covers Zend\Mail\Header\HeaderWrap<extended>
*/
class HeaderWrapTest extends \PHPUnit_Framework_TestCase
class HeaderWrapTest extends TestCase
{
public function testWrapUnstructuredHeaderAscii()
{
$string = str_repeat('foobarblahblahblah baz bat', 4);
$header = $this->getMock('Zend\Mail\Header\UnstructuredInterface');
$header = $this->createMock('Zend\Mail\Header\UnstructuredInterface');
$header->expects($this->any())
->method('getEncoding')
->will($this->returnValue('ASCII'));
Expand All @@ -37,7 +38,7 @@ public function testWrapUnstructuredHeaderAscii()
public function testWrapUnstructuredHeaderMime()
{
$string = str_repeat('foobarblahblahblah baz bat', 3);
$header = $this->getMock('Zend\Mail\Header\UnstructuredInterface');
$header = $this->createMock('Zend\Mail\Header\UnstructuredInterface');
$header->expects($this->any())
->method('getEncoding')
->will($this->returnValue('UTF-8'));
Expand Down
Loading