Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PHPUnit to 9.5 #241

Merged
merged 14 commits into from
Jul 8, 2023
Merged

Update PHPUnit to 9.5 #241

merged 14 commits into from
Jul 8, 2023

Conversation

AntonyThorpe
Copy link
Contributor

As noted in issue #240, this PR upgrades SilverStripe-Omnipay to PHPUnit 9.5. The only breaking change is with the lang files where SilverStripe\Omnipay\Model\Payment.TitleTemplateDateFormat was added to the getTitle function in Payment.php.

php-http/discovery required for 7.4 tests
Upgraded PHPUnit to 9.5 and to php-http/guzzle7-adapter
Wrapped testsuite in testsuites
To tearDown, setUpBeforeClass and tearDownAfterClass functions
Upgraded to php-http/guzzle7-adapter
Reduced decimal places due to the limitation of using the number_format function
To all functions that expect failure
- Changed a payment gateway url to sec.windcave.com for Payment Express tests.  Updated the version of omnipay/paymentexpress in composer.json to account for a recent branding change.
- Changed assertInternalType('array', etc.) to assertIsArray
- For Guzzlehttp\Psr7, replaced parse_response with Message::parseResponse
- Replaced contains function with a callback in BasePurchaseServiceTest.php
- Updated PaymentMathTest.php because the function bcsub cannot have a precision below 0
- Replaced strftime in Payment.php with date_format.  Added SilverStripe\Omnipay\Model\Payment\TitleTemplateDateFormat to the language files.  Removed unnecessary tests in PaymentModelTest.php because language settings cannot be dynamically changed.
- Added symfony/http-foundation as a dev dependency to composer.json
- Added php_codesniffer to ci.yml to ensure it is loaded
- Updated phpcs.xml.dist to align with the one used by SilverStripe Framework
Code beautifier & fixer
Replaced by GitHub Actions
@wilr wilr merged commit 2fa22df into silverstripe:3.2 Jul 8, 2023
wilr added a commit that referenced this pull request Jul 8, 2023
* [CVE-2022-29254] Add extra validation on payment completion

* Update PHPUnit to 9.5 (#241)

* Added Github Actions Workflows

php-http/discovery required for 7.4 tests

* Updated composer.json

Upgraded PHPUnit to 9.5 and to php-http/guzzle7-adapter

* PHPUnit: Added void return type

setUp function

* PHPUnit: Added @doesNotPerformAssertions

For incomplete tests

* PHPUnit: Updated phpunit.xml.dist

Wrapped testsuite in testsuites

* PHPUnit: Added additional void return type

To tearDown, setUpBeforeClass and tearDownAfterClass functions

* PHPUnit: updated PaymentTest.php

Upgraded to php-http/guzzle7-adapter

* PHPUnit: updated PaymentMathTest.php

Reduced decimal places due to the limitation of using the number_format function

* PHP8.1 Compatibility

As per PR #239

* PHPUnit: added guzzlehttp/psr7 to composer.json

As a dev dependency

* PHPUnit: added expectException function

To all functions that expect failure

* PHPUnit: updated various as highlighted by GitHub Actions

- Changed a payment gateway url to sec.windcave.com for Payment Express tests.  Updated the version of omnipay/paymentexpress in composer.json to account for a recent branding change.
- Changed assertInternalType('array', etc.) to assertIsArray
- For Guzzlehttp\Psr7, replaced parse_response with Message::parseResponse
- Replaced contains function with a callback in BasePurchaseServiceTest.php
- Updated PaymentMathTest.php because the function bcsub cannot have a precision below 0
- Replaced strftime in Payment.php with date_format.  Added SilverStripe\Omnipay\Model\Payment\TitleTemplateDateFormat to the language files.  Removed unnecessary tests in PaymentModelTest.php because language settings cannot be dynamically changed.
- Added symfony/http-foundation as a dev dependency to composer.json
- Added php_codesniffer to ci.yml to ensure it is loaded
- Updated phpcs.xml.dist to align with the one used by SilverStripe Framework

* Updated various with PHP_CodeSniffer

Code beautifier & fixer

* Dropped travis

Replaced by GitHub Actions

---------

Co-authored-by: Loz Calver <kinglozzer@gmail.com>
Co-authored-by: Antony Thorpe <1023740+AntonyThorpe@users.noreply.github.com>
@AntonyThorpe AntonyThorpe deleted the PHPUnit95 branch July 10, 2023 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants