diff --git a/.travis.yml b/.travis.yml index cc05e8a..10f717a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,12 @@ language: php php: - - 5.3 - - 5.4 + - 5.6 + - 7.0 + +cache: + directories: + - $HOME/.composer/cache before_script: - composer install --dev --prefer-source diff --git a/CHANGELOG.md b/CHANGELOG.md index dfeeb52..d91f8af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # CHANGELOG +## 2.0.0 +- bump to aws-sdk-for-php ZF2 module to 2.* +-- which in turn bumps support to AWS SDK for PHP v3 + ## 1.6.0 diff --git a/README.md b/README.md index bc2a6df..ddc4ebc 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Here are the currently supported services: Requirements ------------ -* PHP 5.3 +* PHP 5.6 * [Zend Framework 2](https://github.com/zendframework/zf2) * [Amazon AWS ZF 2 Module](https://github.com/aws/aws-sdk-php-zf2): only if you plan to use Amazon SES service @@ -49,7 +49,7 @@ file called `composer.json` and save it in the root of your project: ``` { "require": { - "slm/mail": "~1.6" + "slm/mail": "~2.0" } } ``` diff --git a/composer.json b/composer.json index 3f66afa..a20b93b 100644 --- a/composer.json +++ b/composer.json @@ -30,12 +30,12 @@ } ], "require": { - "php": ">=5.3.3", + "php": ">=5.6", "zendframework/zend-mail": "~2.0", "zendframework/zend-http": "~2.0" }, "require-dev": { - "aws/aws-sdk-php-zf2": ">=1.0.1", + "aws/aws-sdk-php-zf2": "~2.0", "zendframework/zendframework": "~2.0" }, "suggest": { diff --git a/src/SlmMail/Factory/SesServiceFactory.php b/src/SlmMail/Factory/SesServiceFactory.php index 1e94be8..08526ca 100644 --- a/src/SlmMail/Factory/SesServiceFactory.php +++ b/src/SlmMail/Factory/SesServiceFactory.php @@ -43,6 +43,7 @@ use SlmMail\Service\SesService; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; +use Aws\Sdk; class SesServiceFactory implements FactoryInterface { @@ -51,6 +52,6 @@ class SesServiceFactory implements FactoryInterface */ public function createService(ServiceLocatorInterface $serviceLocator) { - return new SesService($serviceLocator->get('Aws')->get('Ses')); + return new SesService($serviceLocator->get(Sdk::class)->createSes()); } } diff --git a/tests/SlmMailTest/Mail/Transport/ElasticEmailTransportTest.php b/tests/SlmMailTest/Mail/Transport/ElasticEmailTransportTest.php index fe1c33d..bfea56a 100644 --- a/tests/SlmMailTest/Mail/Transport/ElasticEmailTransportTest.php +++ b/tests/SlmMailTest/Mail/Transport/ElasticEmailTransportTest.php @@ -60,7 +60,7 @@ public function testCreateFromFactory() public function testTransportUsesElasticEmailService() { - $service = $this->getMock('SlmMail\Service\ElasticEmailService', array(), array('my-username', 'my-secret-key')); + $service = $this->createMock('SlmMail\Service\ElasticEmailService', array(), array('my-username', 'my-secret-key')); $transport = new HttpTransport($service); $message = new Message(); diff --git a/tests/SlmMailTest/Mail/Transport/MailgunTransportTest.php b/tests/SlmMailTest/Mail/Transport/MailgunTransportTest.php index e398953..420c6c6 100644 --- a/tests/SlmMailTest/Mail/Transport/MailgunTransportTest.php +++ b/tests/SlmMailTest/Mail/Transport/MailgunTransportTest.php @@ -60,7 +60,7 @@ public function testCreateFromFactory() public function testTransportUsesMailgunService() { - $service = $this->getMock('SlmMail\Service\MailgunService', array(), array('my-domain', 'my-secret-key')); + $service = $this->createMock('SlmMail\Service\MailgunService', array(), array('my-domain', 'my-secret-key')); $transport = new HttpTransport($service); $message = new Message(); diff --git a/tests/SlmMailTest/Mail/Transport/MandrillTransportTest.php b/tests/SlmMailTest/Mail/Transport/MandrillTransportTest.php index 75f0710..5ba2f5d 100644 --- a/tests/SlmMailTest/Mail/Transport/MandrillTransportTest.php +++ b/tests/SlmMailTest/Mail/Transport/MandrillTransportTest.php @@ -60,7 +60,7 @@ public function testCreateFromFactory() public function testTransportUsesMandrillService() { - $service = $this->getMock('SlmMail\Service\MandrillService', array(), array('my-secret-key')); + $service = $this->createMock('SlmMail\Service\MandrillService', array(), array('my-secret-key')); $transport = new HttpTransport($service); $message = new Message(); diff --git a/tests/SlmMailTest/Mail/Transport/PostageTransportTest.php b/tests/SlmMailTest/Mail/Transport/PostageTransportTest.php index 6be5341..090c7b2 100644 --- a/tests/SlmMailTest/Mail/Transport/PostageTransportTest.php +++ b/tests/SlmMailTest/Mail/Transport/PostageTransportTest.php @@ -60,7 +60,7 @@ public function testCreateFromFactory() public function testTransportUsesPostageService() { - $service = $this->getMock('SlmMail\Service\PostageService', array(), array('my-secret-key')); + $service = $this->createMock('SlmMail\Service\PostageService', array(), array('my-secret-key')); $transport = new HttpTransport($service); $message = new Message(); diff --git a/tests/SlmMailTest/Mail/Transport/PostmarkTransportTest.php b/tests/SlmMailTest/Mail/Transport/PostmarkTransportTest.php index 9660efe..a3d5d36 100644 --- a/tests/SlmMailTest/Mail/Transport/PostmarkTransportTest.php +++ b/tests/SlmMailTest/Mail/Transport/PostmarkTransportTest.php @@ -60,7 +60,7 @@ public function testCreateFromFactory() public function testTransportUsesPostmarkService() { - $service = $this->getMock('SlmMail\Service\PostmarkService', array(), array('my-secret-key')); + $service = $this->createMock('SlmMail\Service\PostmarkService', array(), array('my-secret-key')); $transport = new HttpTransport($service); $message = new Message(); diff --git a/tests/SlmMailTest/Mail/Transport/SendGridTransportTest.php b/tests/SlmMailTest/Mail/Transport/SendGridTransportTest.php index 09da5cd..272ede0 100644 --- a/tests/SlmMailTest/Mail/Transport/SendGridTransportTest.php +++ b/tests/SlmMailTest/Mail/Transport/SendGridTransportTest.php @@ -60,7 +60,7 @@ public function testCreateFromFactory() public function testTransportUsesSendGridService() { - $service = $this->getMock('SlmMail\Service\SendGridService', array(), array('my-username', 'my-secret-key')); + $service = $this->createMock('SlmMail\Service\SendGridService', array(), array('my-username', 'my-secret-key')); $transport = new HttpTransport($service); $message = new Message(); diff --git a/tests/SlmMailTest/Mail/Transport/SesTransportTest.php b/tests/SlmMailTest/Mail/Transport/SesTransportTest.php index 6b679f6..d44af10 100644 --- a/tests/SlmMailTest/Mail/Transport/SesTransportTest.php +++ b/tests/SlmMailTest/Mail/Transport/SesTransportTest.php @@ -52,12 +52,11 @@ public function testCreateFromFactory() $serviceManager->setAllowOverride(true); $self = $this; - $serviceManager->setFactory('Aws', function() use ($self) { - $aws = $self->getMock('Guzzle\Service\Builder\ServiceBuilderInterface'); + $serviceManager->setFactory('AwsModule', function() use ($self) { + $aws = $self->createMock('Guzzle\Service\Builder\ServiceBuilderInterface'); $aws->expects($self->once()) - ->method('get') - ->with($self->equalTo('Ses')) - ->will($self->returnValue($self->getMock('Aws\Ses\SesClient', array(), array(), '', false))); + ->method('createSes') + ->will($self->returnValue($self->createMock('Aws\Ses\SesClient', array(), array(), '', false))); return $aws; }); @@ -74,8 +73,8 @@ public function testCreateFromFactory() public function testTransportUsesSesService() { - $client = $this->getMock('Aws\Ses\SesClient', array(), array(), '', false); - $service = $this->getMock('SlmMail\Service\SesService', array(), array($client)); + $client = $this->createMock('Aws\Ses\SesClient', array(), array(), '', false); + $service = $this->createMock('SlmMail\Service\SesService', array(), array($client)); $transport = new HttpTransport($service); $message = new Message(); diff --git a/tests/SlmMailTest/Util/ServiceManagerFactory.php b/tests/SlmMailTest/Util/ServiceManagerFactory.php index 4630e78..eb9fda3 100644 --- a/tests/SlmMailTest/Util/ServiceManagerFactory.php +++ b/tests/SlmMailTest/Util/ServiceManagerFactory.php @@ -74,7 +74,7 @@ public static function getServiceManager() isset(static::$config['service_manager']) ? static::$config['service_manager'] : array() )); $serviceManager->setService('ApplicationConfig', static::$config); - $serviceManager->setFactory('ServiceListener', 'Zend\Mvc\Service\ServiceListenerFactory'); + //$serviceManager->setFactory('ServiceListener', 'Zend\Mvc\Service\ServiceListenerFactory'); /** @var $moduleManager \Zend\ModuleManager\ModuleManager */ $moduleManager = $serviceManager->get('ModuleManager'); diff --git a/tests/TestConfiguration.php.dist b/tests/TestConfiguration.php.dist index 2b5b43f..1aeb7b8 100644 --- a/tests/TestConfiguration.php.dist +++ b/tests/TestConfiguration.php.dist @@ -18,7 +18,7 @@ */ return array( 'modules' => array( - 'Aws', + 'AwsModule', 'SlmMail', ), 'module_listener_options' => array( diff --git a/tests/testing.config.php b/tests/testing.config.php index 2bd21fc..b139efb 100644 --- a/tests/testing.config.php +++ b/tests/testing.config.php @@ -1,42 +1,36 @@ array( 'elastic_email' => array( 'username' => 'my-username', - 'key' => 'my-secret-key' + 'key' => 'my-secret-key' ), - + 'mandrill' => array( 'key' => 'my-secret-key' ), - + 'postage' => array( 'key' => 'my-secret-key' ), - + 'postmark' => array( 'key' => 'my-secret-key' ), - + 'mailgun' => array( 'domain' => 'my-domain', - 'key' => 'my-key' + 'key' => 'my-key' ), - + 'send_grid' => array( 'username' => 'my-username', - 'key' => 'my-key' + 'key' => 'my-key' ) ), - + 'aws' => array( - 'services' => array( - 'ses' => array( - 'params' => array( - 'region' => 'us-east-1' - ) - ) - ) + 'region' => 'us-east-1', + 'version' => 'latest' ) );