diff --git a/framework/db/BaseActiveRecord.php b/framework/db/BaseActiveRecord.php index 384b323168..b5daa4b17b 100644 --- a/framework/db/BaseActiveRecord.php +++ b/framework/db/BaseActiveRecord.php @@ -667,7 +667,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface } } - $values = $this->getDirtyAttributes($attributes); + $values = $this->getDirtyAttributes($attrs); if (empty($values)) { return 0; } diff --git a/tests/unit/framework/ar/ActiveRecordTestTrait.php b/tests/unit/framework/ar/ActiveRecordTestTrait.php index d7f81512f5..fc980fd646 100644 --- a/tests/unit/framework/ar/ActiveRecordTestTrait.php +++ b/tests/unit/framework/ar/ActiveRecordTestTrait.php @@ -867,7 +867,7 @@ trait ActiveRecordTestTrait /* @var $customerClass \yii\db\ActiveRecordInterface */ $customerClass = $this->getCustomerClass(); /* @var $this TestCase|ActiveRecordTestTrait */ - // save + /* @var $customer Customer */ $customer = $customerClass::findOne(2); $this->assertTrue($customer instanceof $customerClass); $this->assertEquals('user2', $customer->name); @@ -879,8 +879,8 @@ trait ActiveRecordTestTrait $this->afterSave(); $this->assertEquals('user2x', $customer->name); $this->assertFalse($customer->isNewRecord); - $this->assertFalse(static::$afterSaveNewRecord); - $this->assertFalse(static::$afterSaveInsert); + $this->assertNull(static::$afterSaveNewRecord); + $this->assertNull(static::$afterSaveInsert); $customer2 = $customerClass::findOne(2); $this->assertEquals('user2x', $customer2->name);