public function testMergeWhere()
 {
     $this->queryBuilder->where('id', 5, SelectQueryBuilder::LESS_THAN);
     $qb = new SelectQueryBuilder();
     $qb->_open(SelectQueryBuilder::LOGICAL_OR)->where('title', 'Dune', SelectQueryBuilder::NOT_EQUALS, null)->_close();
     $this->queryBuilder->mergeWhere($qb);
     $expected = array(array('column' => 'id', 'value' => 5, 'operator' => '<', 'connector' => 'AND'), array('bracket' => '(', 'connector' => 'OR'), array('column' => 'title', 'value' => 'Dune', 'operator' => '!=', 'connector' => 'AND'), array('bracket' => ')', 'connector' => NULL));
     $this->assertEquals($expected, $this->queryBuilder->getWhereParts());
 }
 public function getQueryStringProvider()
 {
     $select1 = new SelectQueryBuilder();
     $select1->select('id');
     $select1->select('title');
     $select1->from('OldBook', 'o');
     $select1->where('price', 8, SelectQueryBuilder::GREATER_THAN_OR_EQUAL);
     return array(array('', array(), array(), null, array(), '', ''), array('book', array('id', 'title'), array(array(1, 'Dune')), null, array(1, 'Dune'), 'INSERT INTO book (id, title) VALUES (?, ?) ', 'INSERT INTO book (id, title) ' . "\n" . 'VALUES ' . "\n" . '(?, ?) ' . "\n"), array('book', array('id', 'title'), array(array(1, 'Dune'), array(2, 'The Man in the High Castles')), null, array(1, 'Dune', 2, 'The Man in the High Castles'), 'INSERT INTO book (id, title) VALUES (?, ?), (?, ?) ', 'INSERT INTO book (id, title) ' . "\n" . 'VALUES ' . "\n" . '(?, ?), ' . "\n" . '(?, ?) ' . "\n"), array('book', array('id', 'title'), array(), $select1, array(1, 'Dune', 2, 'The Man in the High Castles'), 'INSERT INTO book (id, title) SELECT id, title FROM OldBook AS o WHERE price >= ? ', 'INSERT INTO book (id, title) ' . "\n" . 'SELECT id, title ' . "\n" . 'FROM OldBook AS o ' . "\n" . 'WHERE price >= ? ' . "\n"), array('book', array('id', 'title'), array(array(3, 'Do Androids Dream of Electric Sheep?')), $select1, array(1, 'Dune', 2, 'The Man in the High Castles'), 'INSERT INTO book (id, title) SELECT id, title FROM OldBook AS o WHERE price >= ? ', 'INSERT INTO book (id, title) ' . "\n" . 'SELECT id, title ' . "\n" . 'FROM OldBook AS o ' . "\n" . 'WHERE price >= ? ' . "\n"));
 }