Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
14 changes: 6 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions tests/MagicActiveRecordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}
23 changes: 23 additions & 0 deletions tests/Stubs/MagicActiveRecord/CategoryWithArrayAccess.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

declare(strict_types=1);

namespace Yiisoft\ActiveRecord\Tests\Stubs\MagicActiveRecord;

use ArrayAccess;
use Yiisoft\ActiveRecord\Tests\Stubs\MagicActiveRecord;
use Yiisoft\ActiveRecord\Trait\ArrayAccessTrait;

/**
* @property int $id
* @property string $name
*/
final class CategoryWithArrayAccess extends MagicActiveRecord implements ArrayAccess
{
use ArrayAccessTrait;

public function tableName(): string
{
return 'category';
}
}
2 changes: 1 addition & 1 deletion tools/infection/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require-dev": {
"infection/infection": "^0.26 || ^0.31.9"
"infection/infection": "^0.29.9 || ^0.32.2"
},
"config": {
"allow-plugins": {
Expand Down
Loading