Example #1
0
 /**
  * @dataProvider dataAddOrderBy
  *
  * @param string $sort2
  * @param string $order2
  * @param string $order1
  * @param array $expectedQueryPart
  * @param string $expectedQuery
  */
 public function testAddOrderBy($sort2, $order2, $order1, $expectedQueryPart, $expectedQuery)
 {
     $this->queryBuilder->orderBy('column1', $order1);
     $this->queryBuilder->addOrderBy($sort2, $order2);
     $this->assertEquals($expectedQueryPart, $this->queryBuilder->getQueryPart('orderBy'));
     $this->assertSame('SELECT  FROM  ' . $expectedQuery, $this->queryBuilder->getSQL());
 }
Example #2
0
 /**
  * @dataProvider dataGetTableName
  *
  * @param string $tableName
  * @param bool $automatic
  * @param string $expected
  */
 public function testGetTableName($tableName, $automatic, $expected)
 {
     if ($automatic !== null) {
         $this->queryBuilder->automaticTablePrefix($automatic);
     }
     $this->assertSame($expected, $this->invokePrivate($this->queryBuilder, 'getTableName', [$tableName]));
 }
Example #3
0
 /**
  * @dataProvider dataGetColumnName
  * @param string $column
  * @param string $prefix
  * @param string $expected
  */
 public function testGetColumnName($column, $prefix, $expected)
 {
     $this->assertSame($expected, $this->queryBuilder->getColumnName($column, $prefix));
 }