diff --git a/.github/workflows/mutation.yml b/.github/workflows/mutation.yml index 64ce0875c..6636aaad2 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 --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 58ad8168d..a8cddd4e1 100644 --- a/Makefile +++ b/Makefile @@ -55,14 +55,12 @@ 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 \ + --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/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 @@ +