Browse Source

Fixes #14211: Fixed regression in Unique and Exist validators

tags/2.0.12
Alexander Makarov 7 years ago
parent
commit
9b8b965fcb
No known key found for this signature in database
GPG Key ID: 3617B79C6A325E4A
  1. 4
      framework/db/ActiveQuery.php
  2. 15
      tests/framework/db/ActiveQueryTest.php

4
framework/db/ActiveQuery.php

@ -822,7 +822,7 @@ class ActiveQuery extends Query implements ActiveQueryInterface
.*?
(?:['"`\]]|}})
|
\w+
.*?
)
(?:
(?:
@ -835,7 +835,7 @@ class ActiveQuery extends Query implements ActiveQueryInterface
.*?
(?:['"`\]]|}})
|
\w+
.*?
)
)?
\s*

15
tests/framework/db/ActiveQueryTest.php

@ -357,4 +357,19 @@ abstract class ActiveQueryTest extends DatabaseTestCase
'{{%order_item}}' => '{{%order_item}}',
], $tables);
}
/**
* @see https://github.com/yiisoft/yii2/issues/14211
*/
public function testGetTableAliasFromTableNameWithDatabase()
{
$query = new ActiveQuery(null);
$query->from = 'tickets.workflows';
$tables = $query->getTablesUsedInFrom();
$this->assertEquals([
'{{tickets.workflows}}' => '{{tickets.workflows}}',
], $tables);
}
}

Loading…
Cancel
Save