From 0932cb9b7808d642ac26c44af61e0a8ea2ae6397 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Wed, 7 Jan 2026 20:15:00 +0300 Subject: [PATCH 1/4] Improve config --- .github/workflows/mutation.yml | 2 +- Makefile | 16 ++++++++-------- tools/infection/composer.json | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/mutation.yml b/.github/workflows/mutation.yml index 64ce0875c..048e2793a 100644 --- a/.github/workflows/mutation.yml +++ b/.github/workflows/mutation.yml @@ -72,6 +72,6 @@ jobs: - name: Run infection. run: | - vendor/bin/infection --threads=2 --ignore-msi-with-no-mutations --min-covered-msi=100 --test-framework-options="--testsuite=Pgsql" + vendor/bin/infection --threads=max --ignore-msi-with-no-mutations --min-covered-msi=100 --test-framework-options="--testsuite=Pgsql" env: STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }} diff --git a/Makefile b/Makefile index 58ad8168d..9ebb8a79f 100644 --- a/Makefile +++ b/Makefile @@ -55,14 +55,14 @@ test-oracle: ## Run Oracle tests psalm: CMD="vendor/bin/psalm --no-cache" ## Run static analysis using Psalm psalm: run -mutation: CMD="\ -vendor/bin/roave-infection-static-analysis-plugin \ ---threads=2 \ ---min-msi=0 \ ---min-covered-msi=100 \ ---ignore-msi-with-no-mutations \ ---only-covered" ## Run mutation tests using Infection -mutation: run +mutation: ## Run mutation tests using Infection + docker compose -f docker/docker-compose.yml -f docker/docker-compose.override.yml --profile pgsql up -d + docker compose -f docker/docker-compose.yml -f docker/docker-compose.override.yml exec php-pgsql \ + vendor/bin/infection \ + --threads=max \ + --min-covered-msi=100 \ + --ignore-msi-with-no-mutations \ + --test-framework-options='--testsuite=Pgsql' composer-require-checker: CMD="vendor/bin/composer-require-checker" ## Check dependencies using Composer Require Checker composer-require-checker: run diff --git a/tools/infection/composer.json b/tools/infection/composer.json index 18be2ea10..e05f10d4a 100644 --- a/tools/infection/composer.json +++ b/tools/infection/composer.json @@ -1,6 +1,6 @@ { "require-dev": { - "infection/infection": "^0.26 || ^0.31.9" + "infection/infection": "^0.29.9 || ^0.32.2" }, "config": { "allow-plugins": { From 7b5808b09c94dc73fa37b4eba3bef5364ff944ae Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Wed, 7 Jan 2026 20:33:05 +0300 Subject: [PATCH 2/4] test --- tests/MagicActiveRecordTest.php | 9 ++++++++ .../CategoryWithArrayAccess.php | 23 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 tests/Stubs/MagicActiveRecord/CategoryWithArrayAccess.php diff --git a/tests/MagicActiveRecordTest.php b/tests/MagicActiveRecordTest.php index ee48cc7bf..21eb46217 100644 --- a/tests/MagicActiveRecordTest.php +++ b/tests/MagicActiveRecordTest.php @@ -13,6 +13,7 @@ use Yiisoft\ActiveRecord\Tests\Stubs\MagicActiveRecord\Alpha; use Yiisoft\ActiveRecord\Tests\Stubs\MagicActiveRecord\Animal; use Yiisoft\ActiveRecord\Tests\Stubs\MagicActiveRecord\Cat; +use Yiisoft\ActiveRecord\Tests\Stubs\MagicActiveRecord\CategoryWithArrayAccess; use Yiisoft\ActiveRecord\Tests\Stubs\MagicActiveRecord\Customer; use Yiisoft\ActiveRecord\Tests\Stubs\MagicActiveRecord\CustomerWithAlias; use Yiisoft\ActiveRecord\Tests\Stubs\MagicActiveRecord\CustomerWithProperties; @@ -982,4 +983,12 @@ public function testRelationQueryCaseSensitive(): void ); $customer->relationQuery('Profile'); } + + public function testOffsetSetWithProperty(): void + { + $model = new CategoryWithArrayAccess(); + $model['name'] = 'new name'; + + $this->assertSame('new name', $model->name); + } } diff --git a/tests/Stubs/MagicActiveRecord/CategoryWithArrayAccess.php b/tests/Stubs/MagicActiveRecord/CategoryWithArrayAccess.php new file mode 100644 index 000000000..c70deef82 --- /dev/null +++ b/tests/Stubs/MagicActiveRecord/CategoryWithArrayAccess.php @@ -0,0 +1,23 @@ + Date: Wed, 7 Jan 2026 21:23:57 +0300 Subject: [PATCH 3/4] fix --- .github/workflows/mutation.yml | 2 +- Makefile | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/mutation.yml b/.github/workflows/mutation.yml index 048e2793a..9de9b937b 100644 --- a/.github/workflows/mutation.yml +++ b/.github/workflows/mutation.yml @@ -72,6 +72,6 @@ jobs: - name: Run infection. run: | - vendor/bin/infection --threads=max --ignore-msi-with-no-mutations --min-covered-msi=100 --test-framework-options="--testsuite=Pgsql" + vendor/bin/infection --ignore-msi-with-no-mutations --min-covered-msi=100 --test-framework-options="--testsuite=Pgsql" env: STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }} diff --git a/Makefile b/Makefile index 9ebb8a79f..42bcad774 100644 --- a/Makefile +++ b/Makefile @@ -59,7 +59,6 @@ mutation: ## Run mutation tests using Infection docker compose -f docker/docker-compose.yml -f docker/docker-compose.override.yml --profile pgsql up -d docker compose -f docker/docker-compose.yml -f docker/docker-compose.override.yml exec php-pgsql \ vendor/bin/infection \ - --threads=max \ --min-covered-msi=100 \ --ignore-msi-with-no-mutations \ --test-framework-options='--testsuite=Pgsql' From 1b0501482105dacff286085424d7eeaa444aaa3f Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Wed, 7 Jan 2026 22:47:01 +0300 Subject: [PATCH 4/4] improve --- .github/workflows/mutation.yml | 2 +- Makefile | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/mutation.yml b/.github/workflows/mutation.yml index 9de9b937b..6636aaad2 100644 --- a/.github/workflows/mutation.yml +++ b/.github/workflows/mutation.yml @@ -72,6 +72,6 @@ jobs: - name: Run infection. run: | - vendor/bin/infection --ignore-msi-with-no-mutations --min-covered-msi=100 --test-framework-options="--testsuite=Pgsql" + vendor/bin/infection --ignore-msi-with-no-mutations --test-framework-options="--testsuite=Pgsql" env: STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }} diff --git a/Makefile b/Makefile index 42bcad774..a8cddd4e1 100644 --- a/Makefile +++ b/Makefile @@ -59,7 +59,6 @@ mutation: ## Run mutation tests using Infection docker compose -f docker/docker-compose.yml -f docker/docker-compose.override.yml --profile pgsql up -d docker compose -f docker/docker-compose.yml -f docker/docker-compose.override.yml exec php-pgsql \ vendor/bin/infection \ - --min-covered-msi=100 \ --ignore-msi-with-no-mutations \ --test-framework-options='--testsuite=Pgsql'