예제 #1
0
파일: TableTest.php 프로젝트: rjsmelo/tiki
 function testInsertWithMultipleValues()
 {
     $mock = $this->getMock('TikiDb');
     $query = 'INSERT INTO `test_table` (`label`, `description`, `count`) VALUES (?, ?, ?)';
     $mock->expects($this->once())->method('query')->with($this->equalTo($query), $this->equalTo(array('hello', 'world', 15)));
     $mock->expects($this->once())->method('lastInsertId')->with()->will($this->returnValue(12));
     $table = new TikiDb_Table($mock, 'test_table');
     $this->assertEquals(12, $table->insert(array('label' => 'hello', 'description' => 'world', 'count' => 15)));
 }