diff --git a/tests/system/Database/Builder/UpdateTest.php b/tests/system/Database/Builder/UpdateTest.php index 1c5405fe1955..c19db3293f96 100644 --- a/tests/system/Database/Builder/UpdateTest.php +++ b/tests/system/Database/Builder/UpdateTest.php @@ -289,4 +289,32 @@ public function testSetWithoutEscape() $this->assertEquals($expectedSQL, str_replace("\n", ' ', $builder->getCompiledUpdate())); $this->assertEquals($expectedBinds, $builder->getBinds()); } + + //-------------------------------------------------------------------- + + public function testSetWithAndWithoutEscape() + { + $builder = new BaseBuilder('mytable', $this->db); + + $builder->testMode() + ->set('foo', 'bar') + ->set('field', 'field+1', false) + ->where('id', 2) + ->update(null, null, null); + + $expectedSQL = 'UPDATE "mytable" SET "foo" = \'bar\', field = field+1 WHERE "id" = 2'; + $expectedBinds = [ + 'foo' => [ + 'bar', + true, + ], + 'id' => [ + 2, + true, + ], + ]; + + $this->assertEquals($expectedSQL, str_replace("\n", ' ', $builder->getCompiledUpdate())); + $this->assertEquals($expectedBinds, $builder->getBinds()); + } }