Skip to content

Commit f474950

Browse files
authored
Merge pull request Payum#726 from Payum/drop-php5-and-symfony2-support
Drop PHP5, Symfony 2. Add Symfony 4. Upgrade phpunit
2 parents 1249500 + f36d23d commit f474950

File tree

319 files changed

+990
-785
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

319 files changed

+990
-785
lines changed

.travis.yml

+12-13
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
language: php
22

3-
#env:
4-
# global:
5-
# - SYMFONY_DEPRECATIONS_HELPER=weak
6-
73
git:
84
depth: 10
95

@@ -16,19 +12,22 @@ cache:
1612
matrix:
1713
include:
1814
- php: 7.0
19-
env: SYMFONY_VERSION=2.8.*
20-
- php: 7.0
21-
env: SYMFONY_VERSION=3.0.* SYMFONY_DEPRECATIONS_HELPER=weak
22-
- php: hhvm
23-
env: SYMFONY_VERSION=2.8.*
24-
allow_failures:
25-
- php: hhvm
15+
env: SYMFONY_VERSION=v3
16+
- php: 7.1
17+
env: SYMFONY_VERSION=v3
18+
- php: 7.2
19+
env: SYMFONY_VERSION=v3
2620

27-
services: mongodb
21+
- php: 7.1
22+
env: SYMFONY_VERSION=v4
23+
- php: 7.2
24+
env: SYMFONY_VERSION=v4
2825

2926
before_install:
3027
- composer self-update
31-
- if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then INI_FILE=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; else INI_FILE=/etc/hhvm/php.ini; fi;
28+
29+
install:
30+
- composer require dunglas/symfony-lock::${SYMFONY_VERSION} --no-update
3231

3332
install:
3433
- if [[ "$SYMFONY_VERSION" = "3.0.*" ]]; then composer remove payum/omnipay-bridge omnipay/common omnipay/dummy omnipay/stripe omnipay/paypal --no-interaction; fi;

UPGRADE.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Upgrades
22

3+
## 1.5.0
4+
5+
* Dropped PHP 5.x support
6+
* Dropped Symfony 2.x support
7+
8+
39
## 1.3.0
410

511
* [http-client] When you update to Payum 1.3.0 the installation will fail because you need to install a client implementation. If you choose php-http/guzzle6-adapter everything will work exactly as before.

composer.json

+12-11
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,22 @@
4949
"require-dev": {
5050
"ext-curl": "*",
5151
"ext-pdo_sqlite": "*",
52-
"payum/omnipay-bridge": "^1",
53-
"omnipay/dummy": "~2.0",
52+
"payum/omnipay-v3-bridge": "^1@alpha",
53+
"omnipay/dummy": "^3@alpha",
54+
"omnipay/common": "^3@dev",
5455
"doctrine/orm": "2.5.*",
55-
"phpunit/phpunit": "~4.0",
56+
"phpunit/phpunit": "^5.7",
5657
"propel/propel1": "~1.7",
5758
"psr/log": "~1.0",
5859
"zendframework/zend-db": "~2",
59-
"symfony/routing": "~2.8|~3.0",
60-
"symfony/http-kernel": "~2.8|~3.0",
61-
"symfony/http-foundation": "~2.8|~3.0",
62-
"symfony/form": "~2.8|~3.0",
63-
"symfony/templating": "~2.8|~3.0",
64-
"symfony/validator": "~2.8|~3.0",
65-
"symfony/phpunit-bridge": "~2.8|~3.0",
66-
"symfony/dependency-injection": "~2.8|~3.0",
60+
"symfony/routing": "^3.1|^4.0",
61+
"symfony/http-kernel": "^3.1|^4.0",
62+
"symfony/http-foundation": "^3.1|^4.0",
63+
"symfony/form": "^3.1|^4.0",
64+
"symfony/templating": "^3.1|^4.0",
65+
"symfony/validator": "^3.1|^4.0",
66+
"symfony/phpunit-bridge": "^3.1|^4.0",
67+
"symfony/dependency-injection": "^3.1|^4.0",
6768
"authorizenet/authorizenet": "~1.8",
6869
"sofort/sofortlib-php": "^3.0",
6970
"paypal/rest-api-sdk-php" : "0.5.*",

src/Payum/AuthorizeNet/Aim/Tests/Action/CaptureActionTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -246,22 +246,22 @@ public function shouldCaptureWithObtainedCreditCard()
246246
*/
247247
protected function createGatewayMock()
248248
{
249-
return $this->getMock('Payum\Core\GatewayInterface');
249+
return $this->createMock('Payum\Core\GatewayInterface');
250250
}
251251

252252
/**
253253
* @return \PHPUnit_Framework_MockObject_MockObject|AuthorizeNetAIM
254254
*/
255255
protected function createAuthorizeNetAIMMock()
256256
{
257-
return $this->getMock('Payum\AuthorizeNet\Aim\Bridge\AuthorizeNet\AuthorizeNetAIM', array(), array(), '', false);
257+
return $this->createMock('Payum\AuthorizeNet\Aim\Bridge\AuthorizeNet\AuthorizeNetAIM', array(), array(), '', false);
258258
}
259259

260260
/**
261261
* @return \PHPUnit_Framework_MockObject_MockObject|\AuthorizeNetAIM_Response
262262
*/
263263
protected function createAuthorizeNetAIMResponseMock()
264264
{
265-
return $this->getMock('AuthorizeNetAIM_Response', array(), array(), '', false);
265+
return $this->createMock('AuthorizeNetAIM_Response', array(), array(), '', false);
266266
}
267267
}

src/Payum/AuthorizeNet/Aim/Tests/Action/ConvertPaymentActionTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public function provideSupportedRequests()
2121
{
2222
return array(
2323
array(new $this->requestClass(new Payment(), 'array')),
24-
array(new $this->requestClass($this->getMock(PaymentInterface::class), 'array')),
25-
array(new $this->requestClass(new Payment(), 'array', $this->getMock('Payum\Core\Security\TokenInterface'))),
24+
array(new $this->requestClass($this->createMock(PaymentInterface::class), 'array')),
25+
array(new $this->requestClass(new Payment(), 'array', $this->createMock('Payum\Core\Security\TokenInterface'))),
2626
);
2727
}
2828

@@ -35,7 +35,7 @@ public function provideNotSupportedRequests()
3535
array($this->getMockForAbstractClass('Payum\Core\Request\Generic', array(array()))),
3636
array(new $this->requestClass(new \stdClass(), 'array')),
3737
array(new $this->requestClass(new Payment(), 'foobar')),
38-
array(new $this->requestClass($this->getMock(PaymentInterface::class), 'foobar')),
38+
array(new $this->requestClass($this->createMock(PaymentInterface::class), 'foobar')),
3939
);
4040
}
4141

@@ -44,7 +44,7 @@ public function provideNotSupportedRequests()
4444
*/
4545
public function shouldCorrectlyConvertPaymentToArray()
4646
{
47-
$gatewayMock = $this->getMock('Payum\Core\GatewayInterface');
47+
$gatewayMock = $this->createMock('Payum\Core\GatewayInterface');
4848
$gatewayMock
4949
->expects($this->once())
5050
->method('execute')
@@ -97,7 +97,7 @@ public function shouldCorrectlyConvertPaymentToArray()
9797
*/
9898
public function shouldNotOverwriteAlreadySetExtraDetails()
9999
{
100-
$gatewayMock = $this->getMock('Payum\Core\GatewayInterface');
100+
$gatewayMock = $this->createMock('Payum\Core\GatewayInterface');
101101
$gatewayMock
102102
->expects($this->once())
103103
->method('execute')

src/Payum/AuthorizeNet/Aim/Tests/Action/StatusActionTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public function shouldMarkCanceledStatusIfArrayObjectHasResponseCodeDeclined()
134134
*/
135135
protected function createGetStatusStub($model)
136136
{
137-
$status = $this->getMock('Payum\Core\Request\GetStatusInterface');
137+
$status = $this->createMock('Payum\Core\Request\GetStatusInterface');
138138

139139
$status
140140
->expects($this->any())

src/Payum/AuthorizeNet/Aim/Tests/AuthorizeNetAimGatewayFactoryTest.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33

44
use Payum\AuthorizeNet\Aim\AuthorizeNetAimGatewayFactory;
55
use Payum\Core\Tests\SkipOnPhp7Trait;
6+
use PHPUnit\Framework\TestCase;
67

7-
class AuthorizeNetAimGatewayFactoryTest extends \PHPUnit_Framework_TestCase
8+
class AuthorizeNetAimGatewayFactoryTest extends TestCase
89
{
910
use SkipOnPhp7Trait;
1011

@@ -41,7 +42,7 @@ public function shouldCreateCoreGatewayFactoryIfNotPassed()
4142
*/
4243
public function shouldUseCoreGatewayFactoryPassedAsSecondArgument()
4344
{
44-
$coreGatewayFactory = $this->getMock('Payum\Core\GatewayFactory');
45+
$coreGatewayFactory = $this->createMock('Payum\Core\GatewayFactory');
4546

4647
$factory = new AuthorizeNetAimGatewayFactory(array(), $coreGatewayFactory);
4748

src/Payum/AuthorizeNet/Aim/composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
},
2626
"require-dev": {
2727
"payum/core": "^1.5@dev",
28-
"phpunit/phpunit": "~4.0",
29-
"symfony/phpunit-bridge": "~2.8|~3.0"
28+
"phpunit/phpunit": "^5.7",
29+
"symfony/phpunit-bridge": "^3.1|^4"
3030
},
3131
"config": {
3232
"bin-dir": "bin"

src/Payum/Be2Bill/Tests/Action/CaptureActionTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function shouldDoNothingIfExeccodeSet()
120120
$apiMock = $this->createApiMock();
121121
$apiMock
122122
->expects($this->never())
123-
->method('gateway')
123+
->method('payment')
124124
;
125125

126126
$action = new CaptureAction();
@@ -348,14 +348,14 @@ public function shouldPassFirstAndCurrentModelsWithObtainCreditCardSubRequest()
348348
*/
349349
protected function createApiMock()
350350
{
351-
return $this->getMock(Api::class, array(), array(), '', false);
351+
return $this->createMock(Api::class, array(), array(), '', false);
352352
}
353353

354354
/**
355355
* @return \PHPUnit_Framework_MockObject_MockObject|GatewayInterface
356356
*/
357357
protected function createGatewayMock()
358358
{
359-
return $this->getMock(GatewayInterface::class);
359+
return $this->createMock(GatewayInterface::class);
360360
}
361361
}

src/Payum/Be2Bill/Tests/Action/CaptureOffsiteActionTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,14 @@ public function shouldUpdateModelWhenComeBackFromBe2billSite()
168168
*/
169169
protected function createApiMock()
170170
{
171-
return $this->getMock(Api::class, array(), array(), '', false);
171+
return $this->createMock(Api::class, array(), array(), '', false);
172172
}
173173

174174
/**
175175
* @return \PHPUnit_Framework_MockObject_MockObject|GatewayInterface
176176
*/
177177
protected function createGatewayMock()
178178
{
179-
return $this->getMock(GatewayInterface::class);
179+
return $this->createMock(GatewayInterface::class);
180180
}
181181
}

src/Payum/Be2Bill/Tests/Action/ConvertPaymentActionTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ public function provideSupportedRequests()
1919
{
2020
return array(
2121
array(new $this->requestClass(new Payment(), 'array')),
22-
array(new $this->requestClass($this->getMock(PaymentInterface::class), 'array')),
23-
array(new $this->requestClass(new Payment(), 'array', $this->getMock('Payum\Core\Security\TokenInterface'))),
22+
array(new $this->requestClass($this->createMock(PaymentInterface::class), 'array')),
23+
array(new $this->requestClass(new Payment(), 'array', $this->createMock('Payum\Core\Security\TokenInterface'))),
2424
);
2525
}
2626

@@ -33,7 +33,7 @@ public function provideNotSupportedRequests()
3333
array($this->getMockForAbstractClass('Payum\Core\Request\Generic', array(array()))),
3434
array(new $this->requestClass(new \stdClass(), 'array')),
3535
array(new $this->requestClass(new Payment(), 'foobar')),
36-
array(new $this->requestClass($this->getMock(PaymentInterface::class), 'foobar')),
36+
array(new $this->requestClass($this->createMock(PaymentInterface::class), 'foobar')),
3737
);
3838
}
3939

src/Payum/Be2Bill/Tests/Action/NotifyActionTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,14 @@ public function shouldUpdateModelIfNotificationValid()
194194
*/
195195
protected function createApiMock()
196196
{
197-
return $this->getMock(Api::class, ['verifyHash'], [], '', false);
197+
return $this->createMock(Api::class, ['verifyHash'], [], '', false);
198198
}
199199

200200
/**
201201
* @return \PHPUnit_Framework_MockObject_MockObject|GatewayInterface
202202
*/
203203
protected function createGatewayMock()
204204
{
205-
return $this->getMock(GatewayInterface::class);
205+
return $this->createMock(GatewayInterface::class);
206206
}
207207
}

src/Payum/Be2Bill/Tests/ApiTest.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
use Http\Message\MessageFactory\GuzzleMessageFactory;
55
use Payum\Be2Bill\Api;
66
use Payum\Core\HttpClientInterface;
7+
use PHPUnit\Framework\TestCase;
78

8-
class ApiTest extends \Phpunit_Framework_TestCase
9+
class ApiTest extends TestCase
910
{
1011
/**
1112
* @test
@@ -204,7 +205,7 @@ public function shouldReturnTrueIfHashesMatched()
204205
*/
205206
protected function createHttpClientMock()
206207
{
207-
return $this->getMock('Payum\Core\HttpClientInterface');
208+
return $this->createMock('Payum\Core\HttpClientInterface');
208209
}
209210

210211
/**

src/Payum/Be2Bill/Tests/Be2BillDirectPaymentFactoryTest.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
use Payum\Core\CoreGatewayFactory;
66
use Payum\Core\GatewayFactory;
77
use Payum\Core\GatewayFactoryInterface;
8+
use PHPUnit\Framework\TestCase;
89

9-
class Be2BillDirectGatewayFactoryTest extends \PHPUnit_Framework_TestCase
10+
class Be2BillDirectGatewayFactoryTest extends TestCase
1011
{
1112
/**
1213
* @test
@@ -41,7 +42,7 @@ public function shouldCreateCoreGatewayFactoryIfNotPassed()
4142
*/
4243
public function shouldUseCoreGatewayFactoryPassedAsSecondArgument()
4344
{
44-
$coreGatewayFactory = $this->getMock(GatewayFactoryInterface::class);
45+
$coreGatewayFactory = $this->createMock(GatewayFactoryInterface::class);
4546

4647
$factory = new Be2BillDirectGatewayFactory(array(), $coreGatewayFactory);
4748

src/Payum/Be2Bill/Tests/Be2BillOffsiteGatewayFactoryTest.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
use Payum\Core\GatewayFactory;
99
use Payum\Core\GatewayFactoryInterface;
1010
use Payum\Core\Storage\StorageInterface;
11+
use PHPUnit\Framework\TestCase;
1112

12-
class Be2billOffsiteGatewayFactoryTest extends \PHPUnit_Framework_TestCase
13+
class Be2billOffsiteGatewayFactoryTest extends TestCase
1314
{
1415
/**
1516
* @test
@@ -44,7 +45,7 @@ public function shouldCreateCoreGatewayFactoryIfNotPassed()
4445
*/
4546
public function shouldUseCoreGatewayFactoryPassedAsSecondArgument()
4647
{
47-
$coreGatewayFactory = $this->getMock(GatewayFactoryInterface::class);
48+
$coreGatewayFactory = $this->createMock(GatewayFactoryInterface::class);
4849

4950
$factory = new Be2BillOffsiteGatewayFactory(array(), $coreGatewayFactory);
5051

src/Payum/Be2Bill/composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
},
2525
"require-dev": {
2626
"payum/core": "^1.5@dev",
27-
"phpunit/phpunit": "~4.0",
27+
"phpunit/phpunit": "^5.7",
2828
"php-http/guzzle6-adapter": "^1.0",
29-
"symfony/phpunit-bridge": "~2.8|~3.0"
29+
"symfony/phpunit-bridge": "^3.1|^4"
3030
},
3131
"config": {
3232
"bin-dir": "bin"

src/Payum/Core/Bridge/Symfony/Form/Type/GatewayFactoriesChoiceType.php

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ public function configureOptions(OptionsResolver $resolver)
2727
{
2828
$resolver->setDefaults(array(
2929
'choices' => $this->defaultChoices,
30-
'choices_as_values' => true,
3130
));
3231
}
3332

src/Payum/Core/PayumBuilder.php

+2
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,8 @@ protected function buildAddedGatewayFactories(GatewayFactoryInterface $coreGatew
600600
}
601601

602602
/**
603+
* @deprecated since 1.5 will be removed in 2.0
604+
*
603605
* @param GatewayFactoryInterface $coreGatewayFactory
604606
*
605607
* @return GatewayFactoryInterface[]

src/Payum/Core/Tests/Action/AuthorizePaymentActionTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class AuthorizePaymentActionTest extends GenericActionTest
1919

2020
public function provideSupportedRequests()
2121
{
22-
$authorize = new $this->requestClass($this->getMock(TokenInterface::class));
23-
$authorize->setModel($this->getMock(PaymentInterface::class));
22+
$authorize = new $this->requestClass($this->createMock(TokenInterface::class));
23+
$authorize->setModel($this->createMock(PaymentInterface::class));
2424

2525
return array(
2626
array(new $this->requestClass(new Payment())),

src/Payum/Core/Tests/Action/CapturePaymentActionTest.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Payum\Core\Request\Capture;
88
use Payum\Core\Request\Convert;
99
use Payum\Core\Request\GetHumanStatus;
10+
use Payum\Core\Security\TokenInterface;
1011
use Payum\Core\Tests\GenericActionTest;
1112

1213
class CapturePaymentActionTest extends GenericActionTest
@@ -17,8 +18,8 @@ class CapturePaymentActionTest extends GenericActionTest
1718

1819
public function provideSupportedRequests()
1920
{
20-
$capture = new $this->requestClass($this->getMock('Payum\Security\TokenInterface'));
21-
$capture->setModel($this->getMock(PaymentInterface::class));
21+
$capture = new $this->requestClass($this->createMock(TokenInterface::class));
22+
$capture->setModel($this->createMock(PaymentInterface::class));
2223

2324
return array(
2425
array(new $this->requestClass(new Payment())),

0 commit comments

Comments
 (0)