Skip to content

Commit 2aab761

Browse files
committed
upgrade PHP requirement: 8.0 → 8.1, code adjustments
1 parent 556fa7f commit 2aab761

File tree

7 files changed

+44
-74
lines changed

7 files changed

+44
-74
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ jobs:
1010
max-parallel: 3
1111
matrix:
1212
php:
13-
- '8.0'
1413
- '8.1'
1514
- '8.2'
1615
- '8.3'
@@ -20,33 +19,17 @@ jobs:
2019
normalize: [ false ]
2120
validate: [ false ]
2221
laravel:
23-
- '8.22'
24-
- '9.0'
25-
- '10.0'
26-
- '11.0.3'
27-
- '12.0'
22+
- '10.48.29'
23+
- '11.45.1'
24+
- '12.19.3'
2825
exclude:
29-
- php: '8.0'
30-
laravel: '9.0'
31-
- php: '8.0'
32-
laravel: '10.0'
3326
- php: '8.1'
34-
laravel: '8.22'
27+
laravel: '11.45.1'
3528
- php: '8.1'
36-
laravel: '9.0'
37-
- php: '8.2'
38-
laravel: '8.22'
39-
- php: '8.2'
40-
laravel: '9.0'
41-
- php: '8.3'
42-
laravel: '8.22'
43-
- php: '8.3'
44-
laravel: '9.0'
45-
- php: '8.4'
46-
laravel: '12.0'
29+
laravel: '12.19.3'
4730
include:
48-
- php: '8.0'
49-
laravel: '9.39.0'
31+
- php: '8.1'
32+
laravel: '10.48.29'
5033
analysis: true
5134
coverage: 'xdebug'
5235
normalize: true
@@ -69,9 +52,6 @@ jobs:
6952
if: matrix.validate == true
7053
run: composer validate --strict
7154

72-
- name: Install Laravel legacy factories support
73-
if: matrix.laravel != '7.0'
74-
run: composer require "laravel/legacy-factories:^1.1" --dev --no-interaction --no-update
7555

7656
#- name: Install Laravel and Orchestra Testbench
7757
# run: composer require "illuminate/contracts:${{ matrix.laravel }}" --no-interaction --no-update
@@ -94,11 +74,11 @@ jobs:
9474
run: composer install --prefer-dist --no-progress
9575

9676
- name: Normalize composer file
97-
if: matrix.normalize == true && matrix.php != '8.0'
77+
if: matrix.normalize == true
9878
run: composer normalize --dry-run
9979

10080
- name: Run test suite
101-
run: vendor/bin/phpunit -v
81+
run: vendor/bin/phpunit
10282

10383
- name: Run static code analysis
10484
if: matrix.analysis == true

composer.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,19 @@
2424
}
2525
],
2626
"require": {
27-
"php": "^8.0 || ^8.1 || ^8.2 || ^8.3 || ^8.4",
27+
"php": "^8.1 || ^8.2 || ^8.3 || ^8.4",
2828
"ext-json": "*",
2929
"funeralzone/valueobjects": "^0.5",
3030
"jenssegers/agent": "^2.6",
31-
"laravel/framework": "^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0",
32-
"gnikyt/basic-shopify-api": "^9.0 || ^10.0 || ^11.0"
31+
"laravel/framework": "^10.0 || ^11.0 || ^12.0",
32+
"gnikyt/basic-shopify-api": "^11.0"
3333
},
3434
"require-dev": {
3535
"laravel/legacy-factories": "^v1.3.0",
3636
"ergebnis/composer-normalize": "^2.8",
3737
"friendsofphp/php-cs-fixer": "^3.0",
3838
"mockery/mockery": "^1.0",
39-
"orchestra/database": "~3.8 || ~4.0 || ~5.0 || ~6.0 || ~7.0 || ~8.0 || ~9.0",
40-
"orchestra/testbench": "~3.8 || ~4.0 || ~5.0 || ~6.0 || ~7.0 || ~8.0 || ~9.0",
39+
"orchestra/testbench": "^8.0 || ^9.0",
4140
"phpstan/phpstan": "^0.12",
4241
"phpunit/phpunit": "~8.0 || ^9.0 || ^10.0 || ^11.0"
4342
},

phpunit.xml.dist

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.0/phpunit.xsd"
4-
backupGlobals="false"
5-
backupStaticAttributes="false"
6-
colors="true"
7-
convertErrorsToExceptions="true"
8-
convertNoticesToExceptions="true"
9-
convertWarningsToExceptions="true"
10-
processIsolation="false"
11-
stopOnError="true"
12-
stopOnFailure="true"
13-
stopOnIncomplete="false"
14-
stopOnSkipped="false"
15-
verbose="false"
2+
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
5+
backupGlobals="false"
6+
colors="true"
7+
processIsolation="false"
8+
stopOnError="true"
9+
stopOnFailure="true"
10+
stopOnIncomplete="false"
11+
stopOnSkipped="false"
12+
cacheDirectory=".phpunit.cache"
13+
backupStaticProperties="false"
1614
>
17-
<coverage>
15+
<testsuites>
16+
<testsuite name="Laravel Shopify Test Suite">
17+
<directory>tests</directory>
18+
</testsuite>
19+
</testsuites>
20+
<logging />
21+
<php>
22+
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF" />
23+
<env name="SHOPIFY_API_KEY" value="00000000000000000000000000000000" />
24+
<env name="SHOPIFY_API_SECRET" value="00000000000000000000000000000000" />
25+
</php>
26+
<source>
1827
<include>
1928
<directory suffix=".php">src/</directory>
2029
</include>
@@ -26,20 +35,5 @@
2635
<directory>src/Messaging/Events/</directory>
2736
<file>src/ShopifyAppProvider.php</file>
2837
</exclude>
29-
<report>
30-
<clover outputFile="build/logs/clover.xml"/>
31-
<text outputFile="php://stdout"/>
32-
</report>
33-
</coverage>
34-
<testsuites>
35-
<testsuite name="Laravel Shopify Test Suite">
36-
<directory>tests</directory>
37-
</testsuite>
38-
</testsuites>
39-
<logging/>
40-
<php>
41-
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
42-
<env name="SHOPIFY_API_KEY" value="00000000000000000000000000000000"/>
43-
<env name="SHOPIFY_API_SECRET" value="00000000000000000000000000000000"/>
44-
</php>
38+
</source>
4539
</phpunit>

src/resources/database/factories/ChargeFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
$factory->define($chargeModel, function (Faker $faker) {
1313
return [
1414
'charge_id' => $faker->randomNumber(8),
15-
'name' => $faker->word,
15+
'name' => $faker->word(),
1616
'price' => $faker->randomFloat(),
1717
'status' => ChargeStatus::ACCEPTED()->toNative(),
1818
];

src/resources/database/factories/PlanFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010

1111
$factory->define($planModel, function (Faker $faker) {
1212
return [
13-
'name' => $faker->word,
13+
'name' => $faker->word(),
1414
'price' => $faker->randomFloat(),
1515
];
1616
});
1717

1818
$factory->state($planModel, 'usage', function ($faker) {
1919
return [
2020
'capped_amount' => $faker->randomFloat(),
21-
'terms' => $faker->sentence,
21+
'terms' => $faker->sentence(),
2222
];
2323
});
2424

src/resources/database/factories/ShopFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
$factory->define($model, function (Faker $faker) {
99
return [
10-
'name' => "{$faker->domainWord}.myshopify.com",
11-
'password' => str_replace('-', '', $faker->uuid),
12-
'email' => $faker->email,
10+
'name' => "{$faker->domainWord()}.myshopify.com",
11+
'password' => str_replace('-', '', $faker->uuid()),
12+
'email' => $faker->email(),
1313
];
1414
});
1515

tests/TestCase.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use Illuminate\Support\Carbon;
1111
use Illuminate\Support\Facades\App;
1212
use Illuminate\Support\Facades\Request as FacadesRequest;
13-
use Orchestra\Database\ConsoleServiceProvider;
1413
use Orchestra\Testbench\TestCase as OrchestraTestCase;
1514
use Osiset\ShopifyApp\Contracts\ShopModel;
1615
use Osiset\ShopifyApp\Objects\Values\Hmac;
@@ -78,10 +77,8 @@ public function setUp(): void
7877

7978
protected function getPackageProviders($app): array
8079
{
81-
// ConsoleServiceProvider required to make migrations work
8280
return [
8381
ShopifyAppProvider::class,
84-
ConsoleServiceProvider::class,
8582
];
8683
}
8784

0 commit comments

Comments
 (0)