Skip to content

Commit b795106

Browse files
AmirrezaNasiriStyleCIBotlaravel-shift
authored
Laravel 11.x Compatibility (#41)
* Apply fixes from StyleCI * Laravel 11.x Compatibility (#40) * Bump dependencies for Laravel 11 * Update GitHub Actions for Laravel 11 * Update coverate matrix * Make it Laravel 11 specific * Add testbench version * WIP: Migrating PHPUnit * WIP: Migrate PHPUnit * WIP: Migrate PHPUnit * WIP: Migrate PHPUnit * WIP: Migrate PHPUnit * WIP: Migrate PHPUnit * WIP: Migrate PHPUnit * Use TestCase * WIP: Fix namespaces * Update docs --------- Co-authored-by: Shift <[email protected]> * Apply fixes from StyleCI --------- Co-authored-by: StyleCI Bot <[email protected]> Co-authored-by: Shift <[email protected]>
1 parent 5020d33 commit b795106

File tree

13 files changed

+69
-66
lines changed

13 files changed

+69
-66
lines changed

.github/workflows/tests.yml

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,18 @@ on:
99
jobs:
1010
linux_tests:
1111
runs-on: ubuntu-20.04
12+
1213
strategy:
1314
fail-fast: true
1415
matrix:
15-
php: ['8.0', '8.1']
16-
laravel: ['9.*', '10.*']
16+
php: ['8.2']
17+
laravel: ['11.*']
18+
testbench: ['9.*']
1719
stability: [prefer-lowest, prefer-stable]
18-
exclude:
19-
- laravel: '10.*'
20-
php: '8.0'
2120
include:
22-
- laravel: '9.*'
23-
testbench: '7.*'
24-
- laravel: '10.*'
25-
testbench: '8.*'
26-
- php: '8.1'
27-
laravel: '10.*'
28-
testbench: '8.*'
29-
stability: 'prefer-stable'
30-
coverage: ''
21+
- laravel: 11.*
22+
stability: prefer-stable
23+
coverage:
3124

3225
name: ${{ matrix.coverage }}PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.stability }} - Ubuntu 20.04
3326

@@ -42,7 +35,7 @@ jobs:
4235
extensions: dom, curl, libxml, mbstring, zip, pcntl
4336
tools: composer:v2
4437
coverage: xdebug
45-
38+
4639
- name: Set Laravel and Testbench versions
4740
uses: nick-invision/retry@v1
4841
with:
@@ -59,13 +52,13 @@ jobs:
5952

6053
- name: Execute tests
6154
continue-on-error: false
62-
run: vendor/bin/phpunit --verbose
63-
if: ${{ !matrix.coverage }}
55+
run: vendor/bin/phpunit
56+
if: '${{ !matrix.coverage }}'
6457

6558
- name: Execute tests with coverage
6659
continue-on-error: false
67-
run: vendor/bin/phpunit --verbose --coverage-clover coverage.xml
68-
if: ${{ matrix.coverage }}
60+
run: vendor/bin/phpunit --coverage-clover coverage.xml
61+
if: '${{ matrix.coverage }}'
6962

7063
- name: Upload coverage to Codecov
7164
uses: codecov/codecov-action@v1
@@ -74,5 +67,4 @@ jobs:
7467
files: ./coverage.xml
7568
path_to_write_report: ./coverage/codecov_report.txt
7669
verbose: true
77-
if: ${{ matrix.coverage }}
78-
70+
if: '${{ matrix.coverage }}'

composer.json

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,28 @@
1111
],
1212
"homepage": "https://github.com/evryn/laravel-toman",
1313
"keywords": [
14-
"zarinpal", "زرین پال",
15-
"idpay", "آیدی پی",
16-
"laravel", "laraveltoman", "laravel-toman",
17-
"toman", "payment", "gateway", "درگاه", "پرداخت"
14+
"zarinpal",
15+
"زرین پال",
16+
"idpay",
17+
"آیدی پی",
18+
"laravel",
19+
"laraveltoman",
20+
"laravel-toman",
21+
"toman",
22+
"payment",
23+
"gateway",
24+
"درگاه",
25+
"پرداخت"
1826
],
1927
"require": {
20-
"php": "^8.0|^8.1",
21-
"guzzlehttp/guzzle": "^7.2",
22-
"laravel/framework": "^9.0|^10.0"
28+
"php": "^8.2",
29+
"guzzlehttp/guzzle": "^7.8",
30+
"laravel/framework": "^11.0"
2331
},
2432
"require-dev": {
25-
"phpunit/phpunit": "^8.0|^9.0",
26-
"mockery/mockery": "^1.3.3",
27-
"orchestra/testbench": "^7.0|^8.0",
33+
"phpunit/phpunit": "^10.5|^11.0",
34+
"mockery/mockery": "^1.6",
35+
"orchestra/testbench": "^9.0",
2836
"sempro/phpunit-pretty-print": "^1.0"
2937
},
3038
"autoload": {

docs/_coverpage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![logo](_media/logo.png)
22

3-
# Laravel Toman <small>3.0</small>
3+
# Laravel Toman <small>4.0</small>
44

55
> A painless payment handler!
66

docs/fa/_coverpage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![logo](../_media/logo.png)
22

3-
# لاراول تومَن <small>3.0</small>
3+
# لاراول تومَن <small>4.0</small>
44

55
> درگاه پرداخت - مثل آب خوردن!
66

docs/fa/getting-started.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
| پکیج | فریم‌ورک Laravel | PHP | وضعیت |
66
| ------------- |:-------------:|:-----:| ---:|
7-
| &lrm;3.\* | &lrm;10.\*, &lrm;9.\* | &lrm;>= 8.0 | فعال 🚀 |
7+
| &lrm;4.\* | &lrm;11.\* | &lrm;>= 8.2 | فعال 🚀 |
8+
| &lrm;3.\* | &lrm;10.\*, &lrm;9.\* | &lrm;>= 8.0 | |
89
| &lrm;2.\* | &lrm;9.\*, &lrm;8.\*, &lrm;7.\* | &lrm;>= 7.3 | |
910
| &lrm;1.\* | &lrm;6.\*, &lrm;5.8.\* | &lrm;>= 7.2 | |
1011

docs/getting-started.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
| Package | Laravel Framework | PHP | Status |
66
| ------------- |:-------------:|:-----:| ---:|
7-
| 3.\* | 10.\*, 9.\* | >= 8.0 | Active 🚀 |
7+
| 4.\* | 11.\* | >= 8.2 | Active 🚀 |
8+
| 3.\* | 10.\*, 9.\* | >= 8.0 | |
89
| 2.\* | 9.\*, 8.\*, 7.\* | >= 7.3 | |
910
| 1.\* | 6.\*, 5.8.\* | >= 7.2 | |
1011

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
loadNavbar: true,
5656
fallbackLanguages: ['fa'],
5757
coverpage: ['/', '/fa/'],
58-
name: 'Laravel Toman<small>2.0</small>',
58+
name: 'Laravel Toman',
5959
repo: 'https://github.com/evryn/laravel-toman/',
6060
alias: {
6161
'/CHANGELOG': 'https://raw.githubusercontent.com/evryn/laravel-toman/master/CHANGELOG.md',

phpunit.xml.dist

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit bootstrap="vendor/autoload.php"
3-
backupGlobals="false"
4-
backupStaticAttributes="false"
5-
colors="true"
6-
verbose="true"
7-
convertErrorsToExceptions="true"
8-
convertNoticesToExceptions="true"
9-
convertWarningsToExceptions="true"
10-
processIsolation="false"
11-
stopOnFailure="false">
12-
<testsuites>
13-
<testsuite name="Evryn LaravelToman Test Suit">
14-
<directory suffix=".php">./tests/</directory>
15-
</testsuite>
16-
</testsuites>
17-
<filter>
18-
<whitelist>
19-
<directory>src/</directory>
20-
</whitelist>
21-
</filter>
22-
</phpunit>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
3+
<testsuites>
4+
<testsuite name="Facades">
5+
<directory>tests/Facades</directory>
6+
</testsuite>
7+
<testsuite name="Gateways">
8+
<directory>tests/Gateways</directory>
9+
</testsuite>
10+
<testsuite name="Misc">
11+
<directory>tests/Misc</directory>
12+
</testsuite>
13+
</testsuites>
14+
<source>
15+
<include>
16+
<directory>src/</directory>
17+
</include>
18+
</source>
19+
</phpunit>

src/PendingRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function provideForGateway(array $fields): Collection
9393
$value = $this->provideAmount();
9494
}
9595

96-
return [$this->getFieldNameForGateway($field) => $value];
96+
return [$this->getFieldNameForGateway($field) => $value];
9797
})->merge($this->customData);
9898
}
9999

tests/Gateways/IDPay/Provider.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
use Evryn\LaravelToman\Gateways\IDPay\Status;
66
use Evryn\LaravelToman\Money;
7+
use Evryn\LaravelToman\Tests\TestCase;
78

8-
class Provider
9+
final class Provider extends TestCase
910
{
1011
public static function endpointProvider()
1112
{

0 commit comments

Comments
 (0)