Exemplo n.º 1
0
 function testNaturalInnerJoin()
 {
     $users = $this->users;
     $profiles = new Table("profiles");
     $select = $users->project(Sirel::star())->innerJoin($profiles)->natural();
     $sqlString = "SELECT * FROM users NATURAL INNER JOIN profiles;";
     $this->assertEquals($sqlString, $select->toSql());
 }
Exemplo n.º 2
0
 function testCreateDelete()
 {
     $this->assertInstanceOf("\\Sirel\\DeleteManager", Sirel::createDelete());
 }
Exemplo n.º 3
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']);
 }