Exemple #1
0
 function testThrowsSyntaxErrorOnLimitedUpdate()
 {
     $users = new Table("users");
     try {
         $this->pdo->exec($users->update()->set(array('created_at' => new DateTime()))->take(2)->toSql());
         $this->fail();
     } catch (\PDOException $e) {
         // Expect a Syntax Error
         $this->assertEquals(1, $e->errorInfo[1]);
     }
 }
Exemple #2
0
 function testMin()
 {
     $users = new Table("users");
     $min = $this->pdo->query($users->project($users->age->min()))->fetchColumn();
     $this->assertEquals(23, $min);
 }
Exemple #3
0
 /**
  * Returns the Table's name
  *
  * @param  Table $table
  * @return string
  */
 protected function visitSirelTable(Table $table)
 {
     return $table->getName();
 }