yiisoft/yii2 · error · Exception

Neither fixture "{$fullClassName}" nor "{$fullClassName}Fixt

Error message

Neither fixture "{$fullClassName}" nor "{$fullClassName}Fixture" was found.

What it means

Error "Neither fixture "{$fullClassName}" nor "{$fullClassName}Fixture" was found." thrown in yiisoft/yii2.

Source

Thrown at framework/console/controllers/FixtureController.php:492

     * @param array $fixtures fixtures to configure
     * @return array
     */
    private function getFixturesConfig($fixtures)
    {
        $config = [];

        foreach ($fixtures as $fixture) {
            $isNamespaced = (strpos($fixture, '\\') !== false);
            // replace linux' path slashes to namespace backslashes, in case if $fixture is non-namespaced relative path
            $fixture = str_replace('/', '\\', $fixture);
            $fullClassName = $isNamespaced ? $fixture : $this->namespace . '\\' . $fixture;

            if (class_exists($fullClassName)) {
                $config[] = $fullClassName;
            } elseif (class_exists($fullClassName . 'Fixture')) {
                $config[] = $fullClassName . 'Fixture';
            } else {
                throw new Exception('Neither fixture "' . $fullClassName . '" nor "' . $fullClassName . 'Fixture" was found.');
            }
        }

        return $config;
    }

    /**
     * Filters fixtures by splitting them in two categories: one that should be applied and not.
     *
     * If fixture is prefixed with "-", for example "-User", that means that fixture should not be loaded,
     * if it is not prefixed it is considered as one to be loaded. Returns array:
     *
     * ```
     * [
     *     'apply' => [
     *         'User',
     *         ...
     *     ],

View on GitHub (pinned to 66f00d18a2)

When it happens

Trigger: Thrown at framework/console/controllers/FixtureController.php:492 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of yiisoft/yii2@66f00d18a2 (2026-08-17). Data as JSON: /api/errors/4d0a980fc14b158b. Report an issue: GitHub.