コード例 #1
0
ファイル: SelectTest.php プロジェクト: ttmdear/juborm
 public function testDelete()
 {
     $this->initConnection();
     $bookstore = $this->dbDiffer('bookstore');
     $bookstore->snapshot();
     $select = BooksOpinions::select();
     $select->delete();
     $bookstore->snapshot();
     $this->assertEquals($bookstore->numOfDeleted(), 5);
     $this->assertEquals($bookstore->numOfChanged(), 5);
 }
コード例 #2
0
ファイル: EntityTest.php プロジェクト: ttmdear/juborm
 public function testSet()
 {
     $this->initConnection();
     $bookstore = $this->dbDiffer('bookstore');
     $bookstore->snapshot();
     $opinions = BooksOpinions::select()->equal('opinion_id', 3)->first();
     $opinions->set('opinion', 'test123');
     $opinions->set('author', 'janek');
     $opinions->save();
     $bookstore->snapshot();
     $this->assertEquals($bookstore->numOfChanged(), 1);
     $this->assertEquals($opinions->get('opinion'), "test123");
     $this->assertEquals($opinions->get('author'), "janek");
 }