@@ -48,10 +48,10 @@ public function testFindExists(): void
4848 $ customerQuery = new ActiveQuery (Customer::class);
4949
5050 $ this ->assertTrue ($ customerQuery ->where (['[[id]] ' => 2 ])->exists ());
51- $ this ->assertTrue ($ customerQuery ->where (['[[id]] ' => 2 ])->select ('[[name]] ' )->exists ());
51+ $ this ->assertTrue ($ customerQuery ->setWhere (['[[id]] ' => 2 ])->select ('[[name]] ' )->exists ());
5252
53- $ this ->assertFalse ($ customerQuery ->where (['[[id]] ' => 42 ])->exists ());
54- $ this ->assertFalse ($ customerQuery ->where (['[[id]] ' => 42 ])->select ('[[name]] ' )->exists ());
53+ $ this ->assertFalse ($ customerQuery ->setWhere (['[[id]] ' => 42 ])->exists ());
54+ $ this ->assertFalse ($ customerQuery ->setWhere (['[[id]] ' => 42 ])->select ('[[name]] ' )->exists ());
5555 }
5656
5757 public function testFindColumn (): void
@@ -104,7 +104,7 @@ public function testFindLazyViaTable(): void
104104 $ this ->assertCount (0 , $ orders ->getBooks ());
105105 $ this ->assertEquals (2 , $ orders ->get ('id ' ));
106106
107- $ orders = $ orderQuery ->where (['id ' => 1 ])->asArray ()->one ();
107+ $ orders = $ orderQuery ->setWhere (['id ' => 1 ])->asArray ()->one ();
108108 $ this ->assertIsArray ($ orders );
109109 }
110110
@@ -234,7 +234,7 @@ public function testFind(): void
234234 $ customer = $ customerQuery ->findOne (['id ' => [5 , 6 , 1 ]]);
235235 $ this ->assertInstanceOf (Customer::class, $ customer );
236236
237- $ customer = $ customerQuery ->where (['id ' => [5 , 6 , 1 ]])->one ();
237+ $ customer = $ customerQuery ->setWhere (['id ' => [5 , 6 , 1 ]])->one ();
238238 $ this ->assertNotNull ($ customer );
239239
240240 /** find by column values */
@@ -380,9 +380,9 @@ public function testFindCount(): void
380380 $ customerQuery = new ActiveQuery (Customer::class);
381381 $ this ->assertEquals (3 , $ customerQuery ->count ());
382382 $ this ->assertEquals (1 , $ customerQuery ->where (['id ' => 1 ])->count ());
383- $ this ->assertEquals (2 , $ customerQuery ->where (['id ' => [1 , 2 ]])->count ());
384- $ this ->assertEquals (2 , $ customerQuery ->where (['id ' => [1 , 2 ]])->offset (1 )->count ());
385- $ this ->assertEquals (2 , $ customerQuery ->where (['id ' => [1 , 2 ]])->offset (2 )->count ());
383+ $ this ->assertEquals (2 , $ customerQuery ->setWhere (['id ' => [1 , 2 ]])->count ());
384+ $ this ->assertEquals (2 , $ customerQuery ->setWhere (['id ' => [1 , 2 ]])->offset (1 )->count ());
385+ $ this ->assertEquals (2 , $ customerQuery ->setWhere (['id ' => [1 , 2 ]])->offset (2 )->count ());
386386
387387 $ customerQuery = new ActiveQuery (Customer::class);
388388 $ this ->assertEquals (3 , $ customerQuery ->limit (1 )->count ());
@@ -455,27 +455,27 @@ public function testFindComplexCondition(): void
455455
456456 $ this ->assertCount (
457457 2 ,
458- $ customerQuery ->where (['OR ' , ['name ' => 'user1 ' ], ['name ' => 'user2 ' ]])->all ()
458+ $ customerQuery ->setWhere (['OR ' , ['name ' => 'user1 ' ], ['name ' => 'user2 ' ]])->all ()
459459 );
460460
461461 $ this ->assertEquals (
462462 2 ,
463- $ customerQuery ->where (['name ' => ['user1 ' , 'user2 ' ]])->count ()
463+ $ customerQuery ->setWhere (['name ' => ['user1 ' , 'user2 ' ]])->count ()
464464 );
465465
466466 $ this ->assertCount (
467467 2 ,
468- $ customerQuery ->where (['name ' => ['user1 ' , 'user2 ' ]])->all ()
468+ $ customerQuery ->setWhere (['name ' => ['user1 ' , 'user2 ' ]])->all ()
469469 );
470470
471471 $ this ->assertEquals (
472472 1 ,
473- $ customerQuery ->where (['AND ' , ['name ' => ['user2 ' , 'user3 ' ]], ['BETWEEN ' , 'status ' , 2 , 4 ]])->count ()
473+ $ customerQuery ->setWhere (['AND ' , ['name ' => ['user2 ' , 'user3 ' ]], ['BETWEEN ' , 'status ' , 2 , 4 ]])->count ()
474474 );
475475
476476 $ this ->assertCount (
477477 1 ,
478- $ customerQuery ->where (['AND ' , ['name ' => ['user2 ' , 'user3 ' ]], ['BETWEEN ' , 'status ' , 2 , 4 ]])->all ()
478+ $ customerQuery ->setWhere (['AND ' , ['name ' => ['user2 ' , 'user3 ' ]], ['BETWEEN ' , 'status ' , 2 , 4 ]])->all ()
479479 );
480480 }
481481
@@ -489,7 +489,7 @@ public function testFindNullValues(): void
489489 $ customer ->setName (null );
490490 $ customer ->save ();
491491
492- $ result = $ customerQuery ->where (['name ' => null ])->all ();
492+ $ result = $ customerQuery ->setWhere (['name ' => null ])->all ();
493493 $ this ->assertCount (1 , $ result );
494494 $ this ->assertEquals (2 , reset ($ result )->getPrimaryKey ());
495495 }
@@ -652,13 +652,13 @@ public function testFindEmptyInCondition(): void
652652 $ customers = $ customerQuery ->where (['id ' => [1 ]])->all ();
653653 $ this ->assertCount (1 , $ customers );
654654
655- $ customers = $ customerQuery ->where (['id ' => []])->all ();
655+ $ customers = $ customerQuery ->setWhere (['id ' => []])->all ();
656656 $ this ->assertCount (0 , $ customers );
657657
658- $ customers = $ customerQuery ->where (['IN ' , 'id ' , [1 ]])->all ();
658+ $ customers = $ customerQuery ->setWhere (['IN ' , 'id ' , [1 ]])->all ();
659659 $ this ->assertCount (1 , $ customers );
660660
661- $ customers = $ customerQuery ->where (['IN ' , 'id ' , []])->all ();
661+ $ customers = $ customerQuery ->setWhere (['IN ' , 'id ' , []])->all ();
662662 $ this ->assertCount (0 , $ customers );
663663 }
664664
@@ -675,7 +675,7 @@ public function testFindEagerIndexBy(): void
675675 $ this ->assertTrue (isset ($ items [1 ]));
676676 $ this ->assertTrue (isset ($ items [2 ]));
677677
678- $ order = $ orderQuery ->with ('itemsIndexed ' )->where (['id ' => 2 ])->one ();
678+ $ order = $ orderQuery ->with ('itemsIndexed ' )->setWhere (['id ' => 2 ])->one ();
679679 $ this ->assertTrue ($ order ->isRelationPopulated ('itemsIndexed ' ));
680680
681681 $ items = $ order ->getItemsIndexed ();
0 commit comments