public function test_placeholders() { $qb = new QueryBuilder(); $foo = $qb->addValue('foo'); $bar = $qb->addValue('bar'); $input = "this is {$foo} and {$bar} and {$foo} again"; $expect = "this is ? and ? and ? again"; $values = array('foo', 'bar', 'foo'); $output = $qb->fixPlaceholders($input); $this->assertEquals($expect, $output[0]); $this->assertEquals($values, $output[1]); }