Skip to content

Commit 9302744

Browse files
committed
Add a unit test
1 parent 57634d0 commit 9302744

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

tests/system/Database/BaseQueryTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,4 +316,23 @@ public function testSetQueryBindsWithSetEscapeFalse()
316316

317317
$this->assertEquals($expected, $query->getQuery());
318318
}
319+
320+
/**
321+
* @see https://github.com/codeigniter4/CodeIgniter4/issues/2762
322+
*/
323+
public function testSetQueryBindsWithSetEscapeFalse2()
324+
{
325+
$query = new Query($this->db);
326+
327+
$binds = [
328+
1,
329+
2,
330+
];
331+
332+
$query->setQuery('SELECT @factorA := ?, @factorB := ?', $binds);
333+
334+
$expected = 'SELECT @factorA := 1, @factorB := 2';
335+
336+
$this->assertEquals($expected, $query->getQuery());
337+
}
319338
}

0 commit comments

Comments
 (0)