{"record":{"id":"efe8e8ed5e9de4a9","repo":"twigphp/Twig","slug":"not-implemented","errorCode":null,"errorMessage":"Not implemented.","messagePattern":"Not implemented\\.","errorType":"exception","errorClass":"BadMethodCallException","httpStatus":null,"severity":"error","filePath":"src/Test/IntegrationTestCase.php","lineNumber":42,"sourceCode":"use Twig\\TwigFunction;\nuse Twig\\TwigTest;\n\n/**\n * Integration test helper.\n *\n * @author Fabien Potencier <fabien@symfony.com>\n * @author Karma Dordrak <drak@zikula.org>\n */\nabstract class IntegrationTestCase extends TestCase\n{\n    /**\n     * @deprecated since Twig 3.13, use getFixturesDirectory() instead.\n     *\n     * @return string\n     */\n    protected function getFixturesDir()\n    {\n        throw new \\BadMethodCallException('Not implemented.');\n    }\n\n    protected static function getFixturesDirectory(): string\n    {\n        throw new \\BadMethodCallException('Not implemented.');\n    }\n\n    /**\n     * @return RuntimeLoaderInterface[]\n     */\n    protected function getRuntimeLoaders()\n    {\n        return [];\n    }\n\n    /**\n     * @return ExtensionInterface[]\n     */","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/twigphp/Twig/blob/a414c3a491defb5a60f2fc88ef79ff37c90010cd/src/Test/IntegrationTestCase.php#L24-L60","documentation":"IntegrationTestCase::getFixturesDir() is the old hook that test subclasses override to point the integration test framework at its fixture files. Since Twig 3.13 it is deprecated in favor of getFixturesDirectory(); the base implementation throws BadMethodCallException('Not implemented.') to force subclasses to override one of the two hooks.","triggerScenarios":"Subclassing IntegrationTestCase without overriding getFixturesDirectory() (or the deprecated getFixturesDir()), then running the tests: getTests() calls getFixturesDir() and hits the base throw.","commonSituations":"Writing a new integration test suite for a Twig extension and forgetting the fixture-directory hook; running test suites from libraries that were upgraded to Twig 3.13+ but kept only the legacy method in a broken state.","solutions":["Override protected static function getFixturesDirectory(): string in your test subclass to return the fixtures path.","If supporting older Twig, keep the legacy getFixturesDir() override (it takes precedence) until the minimum is 3.13.","Migrate existing suites from getFixturesDir() to getFixturesDirectory() to silence the deprecation."],"exampleFix":"// before\nclass MyIntegrationTest extends IntegrationTestCase\n{\n    // no fixture directory override\n}\n\n// after\nclass MyIntegrationTest extends IntegrationTestCase\n{\n    protected static function getFixturesDirectory(): string\n    {\n        return __DIR__.'/Fixtures/';\n    }\n}","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Override getFixturesDirectory() in every IntegrationTestCase subclass","Migrate off the deprecated getFixturesDir() hook when requiring Twig 3.13+","Run the test suite once with zero tests configured to catch the missing hook early"],"tags":["twig","php","testing","deprecated-api","phpunit"],"backgroundTag":"abstract-method-not-implemented","analyzedSha":"a414c3a491defb5a60f2fc88ef79ff37c90010cd","analyzedAt":"2026-09-13T15:10:46.849Z","contentChangedAt":"2026-09-13T15:10:46.849Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}