Ejemplo n.º 1
0
 /**
  * @param integer $testId
  * @param array $ids
  */
 protected function checkOtherTestQuestions($testId, $ids = [1000, 2000, 3000, 4000, 5000])
 {
     $questions = IntervalQuestion::find()->where(['test_id' => $testId])->orderBy(['id' => SORT_ASC])->all();
     $questionsSort = ArrayHelper::getColumn($questions, 'sort');
     $this->assertEquals($ids, $questionsSort, 'Other scope models sort matches');
 }
Ejemplo n.º 2
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return ['sort' => ['class' => IntervalNumericalSortableBehavior::className(), 'scope' => function () {
         return IntervalQuestion::find()->where(['test_id' => $this->test_id]);
     }, 'sortableCondition' => ['is_active' => 1]]];
 }