Esempio n. 1
0
 function testFetchRow()
 {
     $mock = $this->getMock('TikiDb');
     $query = 'SELECT `user`, `email` FROM `users_users` WHERE 1=1 AND `userId` = ?';
     $row = array('user' => 'hello', 'email' => '*****@*****.**');
     $mock->expects($this->once())->method('fetchAll')->with($this->equalTo($query), $this->equalTo(array(42)), $this->equalTo(1), $this->equalTo(0))->will($this->returnValue(array($row)));
     $table = new TikiDb_Table($mock, 'users_users');
     $this->assertEquals($row, $table->fetchRow(array('user', 'email'), array('userId' => 42)));
 }