Skip to content

Commit

Permalink
Merge pull request #16 from justbetter/feature/laravel-11
Browse files Browse the repository at this point in the history
Support Laravel 11
  • Loading branch information
VincentBean authored Mar 29, 2024
2 parents 9043a77 + a884f6d commit fa2b7e7
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 28 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/analyse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,20 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.1]
laravel: [10.*]
php: [8.3]
laravel: [10.*, 11.*]
stability: [prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
- laravel: 11.*
testbench: 9.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,21 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ubuntu-22.04]
php: [8.1]
laravel: [10.*]
os: [ubuntu-latest]
php: [8.3]
laravel: [10.*, 11.*]
stability: [prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
- laravel: 11.*
testbench: 9.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
php-version: 8.3
extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: none

Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,23 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.1, 8.2]
laravel: [10.*]
php: [8.1, 8.2, 8.3]
laravel: [10.*, 11.*]
stability: [prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
- laravel: 11.*
testbench: 9.*
exclude:
- laravel: 11.*
php: 8.1

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
"require": {
"php": "^8.1",
"justbetter/laravel-error-logger": "^2.3",
"justbetter/laravel-magento-client": "^1.4",
"justbetter/laravel-magento-products": "^1.1",
"laravel/framework": "^10.0",
"justbetter/laravel-magento-client": "^2.4",
"justbetter/laravel-magento-products": "^1.4",
"laravel/framework": "^10.0|^11.0",
"spatie/laravel-activitylog": "^4.7"
},
"require-dev": {
"doctrine/dbal": "^3.4",
"larastan/larastan": "^2.9",
"laravel/pint": "^1.6",
"nunomaduro/larastan": "^2.5",
"orchestra/testbench": "^8.11",
"orchestra/testbench": "^8.0|^9.0",
"phpstan/phpstan-mockery": "^1.1",
"phpunit/phpunit": "^10.0"
},
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
includes:
- ./vendor/nunomaduro/larastan/extension.neon
- ./vendor/larastan/larastan/extension.neon
- ./vendor/phpstan/phpstan-mockery/extension.neon

parameters:
Expand Down
2 changes: 1 addition & 1 deletion tests/Actions/CompareSimpleStockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function test_quantity_equals(int $magentoQty, int $localQty, bool $shoul
});

Http::fake([
'http://magento.test/rest/all/V1/products/%3A%3Asku%3A%3A' => Http::response([
'magento/rest/all/V1/products/%3A%3Asku%3A%3A' => Http::response([
'extension_attributes' => [
'stock_item' => [
'qty' => $magentoQty,
Expand Down
6 changes: 3 additions & 3 deletions tests/Actions/UpdateBackordersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected function setUp(): void
public function test_it_updates_backorders(): void
{
Http::fake([
'http://magento.test/rest/all/V1/products/%3A%3Asku%3A%3A' => Http::response(),
'magento/rest/all/V1/products/%3A%3Asku%3A%3A' => Http::response(),
]);

$model = MagentoStock::query()
Expand Down Expand Up @@ -56,7 +56,7 @@ public function test_it_updates_backorders_async(): void
config()->set('magento-stock.async', true);

Http::fake([
'http://magento.test/rest/all/async/V1/products/%3A%3Asku%3A%3A' => Http::response(),
'magento/rest/all/async/V1/products/%3A%3Asku%3A%3A' => Http::response(),
]);

$model = MagentoStock::query()
Expand Down Expand Up @@ -89,7 +89,7 @@ public function test_it_updates_backorders_async(): void
public function test_it_logs_backorders_error(): void
{
Http::fake([
'http://magento.test/rest/all/V1/products/%3A%3Asku%3A%3A' => Http::response('::error::', 500),
'magento/rest/all/V1/products/%3A%3Asku%3A%3A' => Http::response('::error::', 500),
]);

$this->expectException(UpdateException::class);
Expand Down
6 changes: 3 additions & 3 deletions tests/Actions/UpdateMsiStockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function test_it_updates_msi_stock(): void

Http::assertSentInOrder([
function (Request $request) {
return $request->url() == 'http://magento.test/rest/all/V1/inventory/sources?searchCriteria%5BpageSize%5D=50&searchCriteria%5BcurrentPage%5D=1';
return $request->url() == 'magento/rest/all/V1/inventory/sources?searchCriteria%5BpageSize%5D=50&searchCriteria%5BcurrentPage%5D=1';
},
function (Request $request) use ($expectedPayload) {
return $request->data() == $expectedPayload;
Expand Down Expand Up @@ -125,7 +125,7 @@ public function test_it_updates_msi_stock_async(): void

Http::assertSentInOrder([
function (Request $request) {
return $request->url() == 'http://magento.test/rest/all/V1/inventory/sources?searchCriteria%5BpageSize%5D=50&searchCriteria%5BcurrentPage%5D=1';
return $request->url() == 'magento/rest/all/V1/inventory/sources?searchCriteria%5BpageSize%5D=50&searchCriteria%5BcurrentPage%5D=1';
},
function (Request $request) use ($expectedPayload) {
return $request->data() == $expectedPayload;
Expand Down Expand Up @@ -157,7 +157,7 @@ public function test_it_stops_when_stockdata_is_empty(): void

Http::assertNotSent(function (Request $request): bool {
return $request->method() === 'POST' &&
$request->url() === 'http://magento.test/rest/all/async/V1/inventory/source-items';
$request->url() === 'magento/rest/all/async/V1/inventory/source-items';
});
}

Expand Down
6 changes: 3 additions & 3 deletions tests/Actions/UpdateSimpleStockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function test_it_updates_simple_stock(): void
{
Event::fake();
Http::fake([
'http://magento.test/rest/all/V1/products/%3A%3Ask%2Fu%3A%3A' => Http::response(),
'magento/rest/all/V1/products/%3A%3Ask%2Fu%3A%3A' => Http::response(),
]);

$model = MagentoStock::query()
Expand Down Expand Up @@ -58,7 +58,7 @@ public function test_it_updates_simple_stock_async(): void

Event::fake();
Http::fake([
'http://magento.test/rest/all/async/V1/products/%3A%3Ask%2Fu%3A%3A' => Http::response(),
'magento/rest/all/async/V1/products/%3A%3Ask%2Fu%3A%3A' => Http::response(),
]);

$model = MagentoStock::query()
Expand Down Expand Up @@ -95,7 +95,7 @@ public function test_it_updates_simple_stock_async(): void
public function test_it_logs_error(): void
{
Http::fake([
'http://magento.test/rest/all/V1/products/%3A%3Asku%3A%3A' => Http::response('::error::', 500),
'magento/rest/all/V1/products/%3A%3Asku%3A%3A' => Http::response('::error::', 500),
]);

$this->expectException(UpdateException::class);
Expand Down

0 comments on commit fa2b7e7

Please sign in to comment.