Ejemplo n.º 1
0
 /**
  * @expectedException \Repo2\QueryBuilder\Exception\CompileException
  * @expectedExceptionMessage The table definition requires columns list.
  */
 public function testErrorOnEmptyColumns()
 {
     $expr = new CreateTable(new Reference('user'), new ExpressionBag());
     $expr->compile(Mock::getMysqliDriver($this));
 }
Ejemplo n.º 2
0
 /**
  * @expectedException \Repo2\QueryBuilder\Exception\CompileException
  * @expectedExceptionMessage No values found for update query.
  */
 public function testErrorOnEmptyValues()
 {
     $select = new UpdateQuery(new Reference('user'), new ExpressionBag());
     $select->compile(Mock::getMysqliDriver($this));
 }
Ejemplo n.º 3
0
 /**
  * @expectedException \Repo2\QueryBuilder\Exception\CompileException
  * @expectedExceptionMessage Data type for the column "id" not defined.
  */
 public function testErrorOnEmptyType()
 {
     $this->createColumn()->compile(Mock::getMysqliDriver($this));
 }
Ejemplo n.º 4
0
 /**
  * @expectedException \InvalidArgumentException
  * @expectedExceptionMessage The field "x" is not found in the row.
  */
 public function testErrorOnWrongRowSequenceInPipe()
 {
     $insert = QueryBuilder\insert('user')->pipe(['x' => 1])->pipe(['y' => 2]);
     $insert->compile(Mock::getMysqliDriver($this));
 }
Ejemplo n.º 5
0
 /**
  * @expectedException \Repo2\QueryBuilder\Exception\CompileException
  * @expectedExceptionMessage The value must be a numeric for increment assignment. Given "string".
  */
 public function testWrongSortType()
 {
     $assign = QueryBuilder\inc('test', 'non_numeric_value');
     $assign->compile(Mock::getMysqliDriver($this));
 }
Ejemplo n.º 6
0
 /**
  * @dataProvider provideGoodField
  */
 public function testGoodQuote($field)
 {
     $this->assertSame('`' . $field . '`', Mock::getMysqliDriver($this)->quote($field));
 }