function testFetchColumnWithSort() { $mock = $this->getMock('TikiDb'); $query = 'SELECT `group` FROM `tiki_group_watches` WHERE 1=1 AND `object` = ? AND `event` = ? ORDER BY `group` ASC'; $mock->expects($this->once())->method('fetchAll')->with($this->equalTo($query), $this->equalTo(array(42, 'foobar')), $this->equalTo(-1), $this->equalTo(-1))->will($this->returnValue(array(array('group' => 'hello'), array('group' => 'world')))); $table = new TikiDb_Table($mock, 'tiki_group_watches'); $this->assertEquals(array('hello', 'world'), $table->fetchColumn('group', array('object' => 42, 'event' => 'foobar'), -1, -1, 'ASC')); }