Skip to content

Commit 7742d3a

Browse files
authored
Add Support to Laravel 11 (#14)
1 parent 962d54b commit 7742d3a

File tree

5 files changed

+83
-81
lines changed

5 files changed

+83
-81
lines changed

.github/workflows/analyse.yml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: analyse
1+
name: Analyse
22

33
on:
44
push:
@@ -8,34 +8,31 @@ on:
88

99
jobs:
1010
phpstan:
11-
1211
runs-on: ubuntu-latest
1312

1413
steps:
15-
- uses: actions/checkout@v2
14+
- name: Checkout code
15+
uses: actions/checkout@v4
1616

1717
- name: Setup PHP
1818
uses: shivammathur/setup-php@v2
1919
with:
20-
php-version: 8.1
20+
php-version: 8.3
2121

22-
- name: Get Composer Cache Directory
22+
- name: Cache Composer packages
2323
id: composer-cache
24-
run: |
25-
echo "::set-output name=dir::$(composer config cache-files-dir)"
26-
27-
- uses: actions/cache@v3
24+
uses: actions/cache@v4
2825
with:
29-
path: ${{ steps.composer-cache.outputs.dir }}
30-
key: ${{ runner.os }}-composer-${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }}
26+
path: vendor
27+
key: ${{ runner.os }}-php-8.3-${{ hashFiles('**/composer.json') }}
3128
restore-keys: |
32-
${{ runner.os }}-composer-8.1
29+
${{ runner.os }}-php-8.3-
3330
3431
- name: Install dependencies
35-
if: steps.cache-descom-laravel-auth.outputs.cache-hit != 'true'
32+
if: steps.composer-cache.outputs.cache-hit != 'true'
3633
run: |
37-
composer install
34+
composer install --no-interaction --no-progress
3835
composer dump
3936
4037
- name: Run analyse phpstan
41-
run: vendor/bin/phpstan analyse --error-format github
38+
run: vendor/bin/phpstan analyse --error-format github

.github/workflows/style-fix.yml

Lines changed: 32 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,41 @@
1-
name: style-fix
1+
name: Style fix
22

33
on:
44
push:
55
branches: [master]
66

77
jobs:
8-
style:
9-
8+
style-fix:
109
runs-on: ubuntu-latest
1110

1211
steps:
13-
- uses: actions/checkout@v2
14-
15-
- name: Setup PHP
16-
uses: shivammathur/setup-php@v2
17-
with:
18-
php-version: 8.1
19-
20-
- name: Get Composer Cache Directory
21-
id: composer-cache
22-
run: |
23-
echo "::set-output name=dir::$(composer config cache-files-dir)"
24-
25-
- uses: actions/cache@v3
26-
with:
27-
path: ${{ steps.composer-cache.outputs.dir }}
28-
key: ${{ runner.os }}-composer-${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }}
29-
restore-keys: |
30-
${{ runner.os }}-composer-8.1
31-
32-
- name: Install dependencies
33-
if: steps.cache-descom-laravel-auth.outputs.cache-hit != 'true'
34-
run: |
35-
composer install
36-
composer dump
37-
38-
- name: Fix styles
39-
run: vendor/bin/php-cs-fixer fix
40-
41-
- uses: EndBug/add-and-commit@v9
42-
43-
- name: Run style
44-
run: vendor/bin/php-cs-fixer fix --dry-run --diff --format junit
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Setup PHP
16+
uses: shivammathur/setup-php@v2
17+
with:
18+
php-version: 8.3
19+
20+
- name: Cache Composer packages
21+
id: composer-cache
22+
uses: actions/cache@v4
23+
with:
24+
path: vendor
25+
key: ${{ runner.os }}-php-8.3-${{ hashFiles('**/composer.json') }}
26+
restore-keys: |
27+
${{ runner.os }}-php-8.3-
28+
29+
- name: Install dependencies
30+
if: steps.composer-cache.outputs.cache-hit != 'true'
31+
run: |
32+
composer install --no-interaction --no-progress
33+
composer dump
34+
35+
- name: Fix styles
36+
run: vendor/bin/php-cs-fixer fix
37+
38+
- name: Run style
39+
run: vendor/bin/php-cs-fixer fix --dry-run --diff --format junit
40+
41+
- uses: EndBug/add-and-commit@v9

.github/workflows/tests.yml

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: tests
1+
name: Tests
22

33
on:
44
push:
@@ -8,31 +8,39 @@ on:
88

99
jobs:
1010
phpunit:
11-
1211
runs-on: ubuntu-latest
1312

1413
strategy:
14+
fail-fast: true
1515
matrix:
16-
php-versions: ['8.3', '8.2', '8.1', '8.0']
16+
php: [8.1, 8.2, 8.3]
1717

1818
steps:
19-
- uses: actions/checkout@v2
20-
21-
- name: Setup PHP
22-
uses: shivammathur/setup-php@v2
23-
with:
24-
php-version: ${{ matrix.php-versions }}
25-
extensions: dom, curl, libxml, mbstring, zip, pcntl, bcmath, intl, exif
26-
coverage: xdebug
27-
28-
29-
- name: Validate composer.json and composer.lock
30-
run: composer validate
31-
32-
- name: Install dependencies
33-
run: |
34-
composer install
35-
composer dump
36-
37-
- name: Run test phpunit
38-
run: vendor/bin/phpunit
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php }}
26+
27+
- name: Validate composer.json
28+
run: composer validate
29+
30+
- name: Cache Composer packages
31+
id: composer-cache
32+
uses: actions/cache@v4
33+
with:
34+
path: vendor
35+
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
36+
restore-keys: |
37+
${{ runner.os }}-php-${{ matrix.php }}-
38+
39+
- name: Install dependencies
40+
if: steps.composer-cache.outputs.cache-hit != 'true'
41+
run: |
42+
composer install --no-interaction --no-progress
43+
composer dump
44+
45+
- name: Run test phpunit
46+
run: vendor/bin/phpunit --stop-on-error --stop-on-failure

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
"guzzlehttp/guzzle": "^7.4",
2727
"league/omnipay": "^3.2",
2828
"omnipay/common": "^3.2",
29-
"illuminate/contracts": "^9.25|^10.0"
29+
"illuminate/contracts": "^9.25|^10.0|^11.0"
3030
},
3131
"require-dev": {
3232
"guzzlehttp/psr7": "^1",
3333
"omnipay/tests": "^4.1",
34-
"phpunit/phpunit": "^9.5",
35-
"orchestra/testbench": "^7.0|^8.0",
34+
"phpunit/phpunit": "^9.5|^10.0|^10.5",
35+
"orchestra/testbench": "^7.0|^8.0|^9.0",
3636
"friendsofphp/php-cs-fixer": "^3.10",
3737
"phpstan/phpstan": "^1.8",
3838
"nunomaduro/larastan": "^2.1"
@@ -44,4 +44,4 @@
4444
]
4545
}
4646
}
47-
}
47+
}

tests/PurchaseTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ public function testPurchaseRedirect()
4949
$responseHtml = $this->gateway
5050
->purchase(
5151
[
52-
'amount' => '12.00',
53-
'description' => 'Test purchase',
54-
'transactionId' => 1,
55-
]
52+
'amount' => '12.00',
53+
'description' => 'Test purchase',
54+
'transactionId' => 1,
55+
]
5656
)->send()
5757
->getRedirectResponse()
5858
->getContent();

0 commit comments

Comments
 (0)