File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed
tests/framework/db/sqlite/conditions Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /**
4+ * @link https://www.yiiframework.com/
5+ * @copyright Copyright (c) 2008 Yii Software LLC
6+ * @license https://www.yiiframework.com/license/
7+ */
8+
9+ declare (strict_types=1 );
10+
11+ namespace yiiunit \framework \db \sqlite \conditions ;
12+
13+ use yii \base \NotSupportedException ;
14+ use yii \db \conditions \InCondition ;
15+ use yii \db \Query ;
16+ use yii \db \sqlite \conditions \InConditionBuilder ;
17+ use yiiunit \framework \db \DatabaseTestCase ;
18+
19+ /**
20+ * @group sqlite
21+ *
22+ * @author Wilmer Arambula <[email protected] > 23+ */
24+ final class InconditionBuilderTest extends DatabaseTestCase
25+ {
26+ public $ driverName = 'sqlite ' ;
27+
28+ public function testBuildSubqueryInCondition (): void
29+ {
30+ $ db = $ this ->getConnection ();
31+ $ query = new Query ();
32+ $ inConditionBuilder = new InConditionBuilder ($ db ->getQueryBuilder ());
33+
34+ $ inCondition = new InCondition (
35+ ['id ' ],
36+ 'in ' ,
37+ $ query ->select ('id ' )->from ('users ' )->where (['active ' => 1 ]),
38+ );
39+
40+ $ this ->expectException (NotSupportedException::class);
41+ $ this ->expectExceptionMessage (
42+ 'yii\db\sqlite\conditions\InConditionBuilder::buildSubqueryInCondition is not supported by SQLite. ' ,
43+ );
44+
45+ $ inConditionBuilder ->build ($ inCondition );
46+ }
47+ }
You can’t perform that action at this time.
0 commit comments