diff --git a/tests/orm/DbTest.php b/tests/orm/DbTest.php index d8f23400..d7886309 100644 --- a/tests/orm/DbTest.php +++ b/tests/orm/DbTest.php @@ -146,11 +146,21 @@ public function testWhereIn() $result = Db::table('test_user')->whereIn('type', [])->column('*'); $this->assertEquals([], $result); + $expected = Collection::make(self::$testUserData)->whereNotIn('type', [1, 3])->values()->toArray(); + $result = Db::table('test_user')->whereNotIn('type', [1, 3])->column('*'); + $this->assertEquals($expected, $result); + + $expected = Collection::make(self::$testUserData)->values()->toArray(); + $result = Db::table('test_user')->whereNotIn('type', [])->column('*'); + $this->assertEquals($expected, $result); + $this->assertEquals([ "SELECT * FROM `test_user` WHERE `type` IN (1,3)", "SELECT * FROM `test_user` WHERE `type` = 1", "SELECT * FROM `test_user` WHERE `type` IN (1,0)", "SELECT * FROM `test_user` WHERE 0 = 1", + "SELECT * FROM `test_user` WHERE `type` NOT IN (1,3)", + "SELECT * FROM `test_user` WHERE 1 = 1", ], $sqlLogs); }