示例#1
0
文件: SelectTest.php 项目: chh/sirel
 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());
 }
示例#2
0
文件: SirelTest.php 项目: chh/sirel
 function testCreateDelete()
 {
     $this->assertInstanceOf("\\Sirel\\DeleteManager", Sirel::createDelete());
 }
示例#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']);
 }