mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-14 19:28:34 +01:00
Further changes for unique and exist validators
- Combined methods for getting names and aliases of from tables - Normalized names and aliases - Added MSSQL syntax - Added support for spaces in aliases and table names
This commit is contained in:
@@ -337,7 +337,7 @@ abstract class UniqueValidatorTest extends DatabaseTestCase
|
||||
$attribute = 'id';
|
||||
$targetAttribute = 'id';
|
||||
$result = $this->invokeMethod(new UniqueValidator(), 'prepareConditions', [$targetAttribute, $model, $attribute]);
|
||||
$expected = [Profile::tableName() . '.' . $attribute => $model->id];
|
||||
$expected = ['{{' . Profile::tableName() . '}}.[[' . $attribute . ']]' => $model->id];
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user