87 {
88
89 require_once './Modules/TestQuestionPool/classes/class.assAnswerOrdering.php';
91 $random_id = 13579;
92
93
94 require_once './Services/Database/classes/class.ilDB.php';
95 $ildb_mock = $this->getMock('ilDBMySQL', array('queryF', 'fetchAssoc'), array(), '', false, false);
96 $ildb_mock->expects( $this->once() )
97 ->method( 'queryF' )
98 ->with( $this->equalTo('SELECT * FROM qpl_a_ordering WHERE random_id = %s'),
99 $this->equalTo(array('integer')),
100 $this->equalTo(array($random_id))
101 )
102 ->will( $this->returnValue('Test') );
103 $ildb_mock->expects( $this->exactly(2) )
104 ->method( 'fetchAssoc' )
105 ->with( $this->equalTo('Test') )
106 ->will( $this->onConsecutiveCalls(array('answer_id' => 123, 'depth' => 456), false ) );
109
110
111 $instance->getAdditionalOrderingFieldsByRandomId($random_id);
112
113
114 $this->assertEquals(123, $instance->getAnswerId());
115 $this->assertEquals(456, $instance->getOrderingDepth());
116 }
Class for ordering question answers.