You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$this->assertStringContainsString('SELECT "user".* FROM "user" WHERE "user"."id" IS NOT NULL AND "user"."id" = 1 AND "user"."id" < 2 AND "user"."id" > 0', $sql);
238
+
$this->assertStringContainsString('SELECT "user".* FROM "user" WHERE "user"."id" IS NOT NULL AND "user"."id" = :ph3 AND "user"."id" < :ph4 AND "user"."id" > :ph5', $sql);
239
239
$this->assertGreaterThan(0, $user->id);
240
240
$this->assertSame([], $user->getDirty());
241
241
$user->name = 'testname';
@@ -685,7 +685,7 @@ public function testWrapMultipleOrStatements()
685
685
->eq('id', 2)
686
686
->find();
687
687
$sql = $record->getBuiltSql();
688
-
$this->assertEquals('SELECT "user".* FROM "user" WHERE "user"."name" IS NOT NULL AND ("user"."name" = :ph1 OR "user"."id" = 1 OR "user"."password" >= :ph2) AND "user"."id" = 2 LIMIT 1', $sql);
688
+
$this->assertEquals('SELECT "user".* FROM "user" WHERE "user"."name" IS NOT NULL AND ("user"."name" = :ph1 OR "user"."id" = :ph2 OR "user"."password" >= :ph3) AND "user"."id" = :ph4 LIMIT 1', $sql);
689
689
}
690
690
691
691
publicfunctiontestWrapWithComplexLogic()
@@ -702,7 +702,7 @@ public function testWrapWithComplexLogic()
$this->assertEquals('SELECT "user".* FROM "user" LEFT JOIN contact ON "contact"."user_id" = "user"."id" WHERE ("user"."name" = :ph1 OR "user"."id" IN (:ph2,:ph3,:ph4) OR "user"."id" = 1) AND "user"."name" IS NOT NULL AND "user"."id" BETWEEN :ph5 AND :ph6 LIMIT 1', $sql);
705
+
$this->assertEquals('SELECT "user".* FROM "user" LEFT JOIN contact ON "contact"."user_id" = "user"."id" WHERE ("user"."name" = :ph1 OR "user"."id" IN (:ph2,:ph3,:ph4) OR "user"."id" = :ph5) AND "user"."name" IS NOT NULL AND "user"."id" BETWEEN :ph6 AND :ph7 LIMIT 1', $sql);
706
706
}
707
707
708
708
publicfunctiontestOrAsFinalParameter()
@@ -714,6 +714,26 @@ public function testOrAsFinalParameter()
714
714
->eq('id', 1, 'or')
715
715
->find();
716
716
$sql = $record->getBuiltSql();
717
-
$this->assertEquals('SELECT "user".* FROM "user" WHERE "user"."name" = :ph1 AND "user"."id" IN (:ph2,:ph3,:ph4) OR "user"."id" = 1 LIMIT 1', $sql);
718
-
}
717
+
$this->assertEquals('SELECT "user".* FROM "user" WHERE "user"."name" = :ph1 AND "user"."id" IN (:ph2,:ph3,:ph4) OR "user"."id" = :ph5 LIMIT 1', $sql);
718
+
}
719
+
720
+
publicfunctiontestBooleanParam()
721
+
{
722
+
$record = newUser(newPDO('sqlite:test.db'));
723
+
$record->eq('name', 'John');
724
+
$record->eq('id', true);
725
+
$record->find();
726
+
$sql = $record->getBuiltSql();
727
+
$this->assertEquals('SELECT "user".* FROM "user" WHERE "user"."name" = :ph1 AND "user"."id" = TRUE LIMIT 1', $sql);
728
+
}
729
+
730
+
publicfunctiontestBooleanParamWithArray()
731
+
{
732
+
$record = newUser(newPDO('sqlite:test.db'));
733
+
$record->eq('name', 'John');
734
+
$record->in('id', [ true, false ]);
735
+
$record->find();
736
+
$sql = $record->getBuiltSql();
737
+
$this->assertEquals('SELECT "user".* FROM "user" WHERE "user"."name" = :ph1 AND "user"."id" IN (TRUE,FALSE) LIMIT 1', $sql);
0 commit comments