예제 #1
0
파일: TableTest.php 프로젝트: rjsmelo/tiki
 function testComplexBuilding()
 {
     $mock = $this->getMock('TikiDb');
     $query = 'UPDATE `my_table` SET `hits` = `weight` * ? * (`hits` + ?) WHERE 1=1 AND `fileId` = ? LIMIT 1';
     $mock->expects($this->once())->method('query')->with($this->equalTo($query), $this->equalTo(array(1.5, 5, 42)));
     $table = new TikiDb_Table($mock, 'my_table');
     $table->update(array('hits' => $table->expr('`weight` * ? * ($$ + ?)', array(1.5, 5))), array('fileId' => 42));
 }