/** * @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'); }
/** * @inheritdoc */ public function behaviors() { return ['sort' => ['class' => IntervalNumericalSortableBehavior::className(), 'scope' => function () { return IntervalQuestion::find()->where(['test_id' => $this->test_id]); }, 'sortableCondition' => ['is_active' => 1]]]; }