diff --git a/.github/workflows/dusk.yml b/.github/workflows/dusk.yml index 505982d46..29b1dc539 100644 --- a/.github/workflows/dusk.yml +++ b/.github/workflows/dusk.yml @@ -2,6 +2,9 @@ name: dusk on: push: + branches: + - master + - '*.x' pull_request: schedule: - cron: '0 0 * * *' @@ -13,26 +16,28 @@ jobs: fail-fast: false matrix: include: - - magento-version: 2.4.5-p2 - magento-php-version: php81-fpm - rapidez-php-version: 8.1 - - magento-version: 2.4.5-p2 + - magento-version: 2.4.5-p9 magento-php-version: php81-fpm rapidez-php-version: 8.2 - - magento-version: 2.4.6 - magento-php-version: php81-fpm - rapidez-php-version: 8.1 - - magento-version: 2.4.6 + + - magento-version: 2.4.6-p7 magento-php-version: php82-fpm rapidez-php-version: 8.2 + - magento-version: 2.4.7-p2 + magento-php-version: php82-fpm + rapidez-php-version: 8.2 + - magento-version: 2.4.7-p2 + magento-php-version: php83-fpm + rapidez-php-version: 8.3 + services: magento: image: michielgerritsen/magento-project-community-edition:${{matrix.magento-php-version}}-magento${{matrix.magento-version}}-sample-data env: URL: http://localhost:1234/ FLAT_TABLES: true - CUSTOM_ENTRYPOINT_COMMAND: "magerun2 config:store:set system/smtp/disable 1" + CUSTOM_ENTRYPOINT_COMMAND: "php bin/magento encryption:key:change -k 5AM3SD5SkwT8iwIxL6L1q8XQhzK3wk51; magerun2 config:store:set system/smtp/disable 1; magerun2 config:store:set checkout/options/enable_guest_checkout_login 1f" ports: - 3307:3306 - 9200:9200 @@ -46,7 +51,7 @@ jobs: - name: Setup Yarn cache uses: actions/setup-node@v4 - + - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -84,9 +89,9 @@ jobs: docker cp ${{ job.services.magento.id }}:/data/var/log magento/var/log - name: Upload Artifact if: failure() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: - name: artifact + name: artifact-P${{ matrix.rapidez-php-version }}-M${{matrix.magento-version}}-on-${{matrix.magento-php-version}} path: | tests/Browser/screenshots tests/Browser/console diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index a185abdbb..e630a2b91 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -1,7 +1,10 @@ -name: phpunit +name: PHPUnit MySQL on: push: + branches: + - master + - '*.x' pull_request: schedule: - cron: '0 0 * * *' @@ -12,16 +15,21 @@ jobs: strategy: fail-fast: false matrix: - php: [8.1, 8.2] - laravel: [10.*] + php: [8.1, 8.2, 8.3] + laravel: [10.*, 11.*] stability: [prefer-lowest, prefer-stable] include: - laravel: 10.* testbench: 8.* + - laravel: 11.* + testbench: 9.* + exclude: + - laravel: 11.* + php: 8.1 services: mysql: - image: mysql:5.7 + image: mysql:8.0.14 env: MYSQL_USER: magento MYSQL_PASSWORD: password diff --git a/.gitignore b/.gitignore index 2de5877b0..902af7b0f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ -.phpunit.result.cache +/.phpunit.cache /node_modules /public /vendor +.phpunit.result.cache composer.lock phpunit.dusk.xml phpunit.xml diff --git a/composer.json b/composer.json index 689c53829..eac6994dc 100644 --- a/composer.json +++ b/composer.json @@ -16,23 +16,23 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": "^8.1|^8.2", - "blade-ui-kit/blade-heroicons": "^2.0", - "mailerlite/laravel-elasticsearch": "^11.0", + "php": "^8.1|^8.2|^8.3", + "blade-ui-kit/blade-heroicons": "^2.4", + "mailerlite/laravel-elasticsearch": "^11.1", "illuminate/database": "^10.0|^11.0", "illuminate/events": "^10.0|^11.0", "illuminate/queue": "^10.0|^11.0", "illuminate/support": "^10.0|^11.0", - "lcobucci/clock": "^2.0|^3.0", - "lcobucci/jwt": "^4.0|^5.0", - "rapidez/blade-directives": "~0.1", + "lcobucci/clock": "^2.0|^3.2", + "lcobucci/jwt": "^4.0|^5.3", + "rapidez/blade-directives": "^0.6", "tormjens/eventy": "^0.8" }, "require-dev": { - "laravel/dusk": "^7.9", - "orchestra/testbench": "^8.8", - "orchestra/testbench-dusk": "^8.8", - "phpunit/phpunit": "^9.5.10|^10.0" + "laravel/dusk": "^8.2", + "orchestra/testbench": "^9.4", + "orchestra/testbench-dusk": "^9.7", + "phpunit/phpunit": "^10.5.34|^11.3.5" }, "autoload": { "psr-4": { diff --git a/phpunit.dusk.xml.dist b/phpunit.dusk.xml.dist index 907d4bb20..6e9e3cef3 100644 --- a/phpunit.dusk.xml.dist +++ b/phpunit.dusk.xml.dist @@ -24,8 +24,10 @@ + + diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 542cc3765..9ffe8cc78 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -25,6 +25,7 @@ + diff --git a/src/Models/Scopes/Attribute/OnlyProductAttributesScope.php b/src/Models/Scopes/Attribute/OnlyProductAttributesScope.php index 580db3ec1..fe2e0c735 100644 --- a/src/Models/Scopes/Attribute/OnlyProductAttributesScope.php +++ b/src/Models/Scopes/Attribute/OnlyProductAttributesScope.php @@ -32,15 +32,15 @@ public function apply(Builder $builder, Model $model) 'used_for_sort_by AS sorting', 'is_visible_on_front AS productpage', 'is_html_allowed_on_front AS html', - DB::raw('NOT(ISNULL(column_name)) AS flat'), + DB::raw('column_name IS NOT NULL AS `flat`'), DB::raw('EXISTS( - SELECT 1 - FROM catalog_product_super_attribute - WHERE catalog_product_super_attribute.attribute_id = eav_attribute.attribute_id - ) AS `super`'), - DB::raw('additional_data->>"$.swatch_input_type" = "text" AS `text_swatch`'), - DB::raw('additional_data->>"$.swatch_input_type" = "visual" AS `visual_swatch`'), - DB::raw('additional_data->>"$.update_product_preview_image" = 1 AS `update_image`'), + SELECT 1 + FROM catalog_product_super_attribute + WHERE catalog_product_super_attribute.attribute_id = eav_attribute.attribute_id + ) AS `super`'), + DB::raw("JSON_UNQUOTE(JSON_EXTRACT(additional_data, '$.swatch_input_type')) = 'text' AS `text_swatch`"), + DB::raw("JSON_UNQUOTE(JSON_EXTRACT(additional_data, '$.swatch_input_type')) = 'visual' AS `visual_swatch`"), + DB::raw("JSON_UNQUOTE(JSON_EXTRACT(additional_data, '$.update_product_preview_image')) = 1 AS `update_image`"), 'position' ) ->join('catalog_eav_attribute', 'eav_attribute.attribute_id', '=', 'catalog_eav_attribute.attribute_id') diff --git a/src/Models/Scopes/Product/WithProductSuperAttributesScope.php b/src/Models/Scopes/Product/WithProductSuperAttributesScope.php index b81afb5bc..741b8143e 100644 --- a/src/Models/Scopes/Product/WithProductSuperAttributesScope.php +++ b/src/Models/Scopes/Product/WithProductSuperAttributesScope.php @@ -41,9 +41,9 @@ public function apply(Builder $builder, Model $model) ->selectRaw('JSON_OBJECTAGG(eav_attribute.attribute_id, JSON_OBJECT( "code", `attribute_code`, "label", COALESCE(NULLIF(`value`, ""), `frontend_label`), - "text_swatch", additional_data->>"$.swatch_input_type" = "text", - "visual_swatch", additional_data->>"$.swatch_input_type" = "visual", - "update_image", additional_data->>"$.update_product_preview_image" = 1 + "text_swatch", JSON_UNQUOTE(JSON_EXTRACT(additional_data, "$.swatch_input_type")) = "text", + "visual_swatch", JSON_UNQUOTE(JSON_EXTRACT(additional_data, "$.swatch_input_type")) = "visual", + "update_image", JSON_UNQUOTE(JSON_EXTRACT(additional_data, "$.update_product_preview_image")) = 1 )) AS `super_attributes`') ->join('eav_attribute', 'eav_attribute.attribute_id', '=', 'catalog_product_super_attribute.attribute_id') ->join('catalog_eav_attribute', 'catalog_eav_attribute.attribute_id', '=', 'catalog_product_super_attribute.attribute_id')