示例#1
0
文件: SirelTest.php 项目: chh/sirel
 function testSqlLiteral()
 {
     $sqlLiteral = Sirel::sql('COUNT(id)');
     $this->assertInstanceOf('\\Sirel\\Node\\SqlLiteral', $sqlLiteral);
     $this->assertEquals('COUNT(id)', $sqlLiteral->expression);
 }
示例#2
0
 function testDeleteAll()
 {
     $users = new Table("users");
     $rowsDeleted = $this->pdo->exec($users->delete()->toSql());
     $this->assertEquals(3, $rowsDeleted);
     $row = $this->pdo->query($users->project(Sirel::sql('COUNT(\'id\') AS count')))->fetch();
     $this->assertEquals(0, $row['count']);
 }