function testSqlLiteral() { $sqlLiteral = Sirel::sql('COUNT(id)'); $this->assertInstanceOf('\\Sirel\\Node\\SqlLiteral', $sqlLiteral); $this->assertEquals('COUNT(id)', $sqlLiteral->expression); }
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']); }