Страница 1 из 1

Fixture depends не работает

Добавлено: 2019.01.29, 07:19
NorthugP
Здравствуйте, пытаюсь сделать одну фикстуру зависимой от другой, но не получается.
Одна фикстура CategoriesFixture, другая SliderFixture

Код: Выделить всё

<?php

namespace common\fixtures;

use yii\test\ActiveFixture;

class CategoriesFixture extends ActiveFixture
{
    public $modelClass = 'common\models\Categories';
    public $dataFile = '@common/fixtures/data/categories.php';
    public $depends = ['common\fixtures\SliderFixture'];
}

Код: Выделить всё

<?php

namespace common\fixtures;

use yii\test\ActiveFixture;

class SliderFixture extends ActiveFixture
{
    public $modelClass = 'common\models\Slider';
    public $dataFile = '@common/fixtures/data/slider.php';
}
Пытаюсь сделать, чтобы SliderFixture срабатывала первой, но всегда срабатывает сначала CategoriesFixture.
Думал вдруг перепутал, ставил наоборот, но все равно не работает.

Re: Fixture depends не работает

Добавлено: 2019.01.29, 10:18
maleks
Вроде корректно, должно SliderFixture первой, может вы путаете что то?