generateQuery() public method

public generateQuery ( $select, $from, $where, $groupBy, $orderBy, $limit, $offset )
Example #1
0
    public function test_generateQuery_WithQueryHint_ShouldAddQueryHintAsComment()
    {
        $this->logAggregator->setQueryOriginHint('MyPluginName');
        $query = $this->logAggregator->generateQuery('test, test2', 'log_visit', '1=1', false, '5');
        $expected = array('sql' => 'SELECT /* MyPluginName */
				test, test2
			FROM
				log_visit AS log_visit
			WHERE
				1=1
			ORDER BY
				5', 'bind' => array(0 => '2012-01-01 00:00:00', 1 => '2012-01-31 23:59:59', 2 => 1));
        $this->assertSame($expected, $query);
    }