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:
Alexander Makarov
2017-05-10 00:34:45 +03:00
parent 37fc6c5afb
commit 23cc4bf4fe
5 changed files with 78 additions and 78 deletions

View File

@@ -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);
}