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()); }
function testCreateDelete() { $this->assertInstanceOf("\\Sirel\\DeleteManager", Sirel::createDelete()); }
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']); }