Exemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return ['sort' => ['class' => ContinuousNumericalSortableBehavior::className(), 'scope' => function () {
         return ContinuousQuestion::find()->where(['test_id' => $this->test_id]);
     }, 'sortableCondition' => ['is_active' => 1]]];
 }
Exemplo n.º 2
0
 /**
  * @param ContinuousQuestion $question
  * @param null|integer $questionSort
  * @param array $otherQuestionsSort
  * @param boolean $checkOtherTestQuestions
  */
 protected function checkQuestion($question, $questionSort = null, $otherQuestionsSort, $checkOtherTestQuestions = true)
 {
     if ($questionSort) {
         $this->assertEquals($questionSort, $question->sort, 'Model sort matches');
     }
     $this->assertEquals($otherQuestionsSort, $question->getOtherQuestionsSort(), 'Other models sort matches');
     if ($checkOtherTestQuestions) {
         $this->checkOtherTestQuestions(2);
     }
 }