{"record":{"id":"96a41d6f4461139a","repo":"filamentphp/filament","slug":"action-name-at-index-actionnestingindex-is-no","errorCode":null,"errorMessage":"Action name at index [{$actionNestingIndex}] is not specified.","messagePattern":"Action name at index \\[(.+?)\\] is not specified\\.","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"packages/actions/src/Testing/TestsActions.php","lineNumber":720,"sourceCode":"            } elseif (\n                ($actions instanceof TestAction) ||\n                array_key_exists('name', $actions)\n            ) {\n                $actions = [$actions];\n            }\n\n            $areArgumentsKeyedByActionName = false;\n\n            foreach ($actions as $actionNestingIndex => $action) {\n                if (is_string($action)) {\n                    $action = [\n                        'name' => $action,\n                    ];\n                } elseif ($action instanceof TestAction) {\n                    $action = $action->toArray(defaultSchema: ($initialMountedActionsCount + $actionNestingIndex) ? ('mountedActionSchema' . ($initialMountedActionsCount + $actionNestingIndex - 1)) : $this->instance()->getDefaultTestingSchemaName());\n                }\n\n                $actionName = $action['name'] ?? throw new LogicException(\"Action name at index [{$actionNestingIndex}] is not specified.\");\n\n                if (\n                    class_exists($actionName) &&\n                    ($actionClassNameAttributes = (new ReflectionClass($actionName))->getAttributes(ActionName::class))\n                ) {\n                    $action['name'] = $actionName = (string) Arr::first($actionClassNameAttributes)->newInstance();\n                }\n\n                if (\n                    class_exists($actionName) &&\n                    is_subclass_of($actionName, Action::class)\n                ) {\n                    $action['name'] = $actionName = $actionName::getDefaultName();\n                }\n\n                if (filled($arguments) && (! array_key_exists('arguments', $action))) {\n                    if (array_key_exists($actionName, $arguments)) {\n                        $action['arguments'] = $arguments[$actionName];","sourceCodeStart":702,"sourceCodeEnd":738,"githubUrl":"https://github.com/filamentphp/filament/blob/53483fa9340e4ec637985fe454ebb58afb92ea24/packages/actions/src/Testing/TestsActions.php#L702-L738","documentation":"Filament's action-testing helpers normalize their `$actions` argument through `parseNestedActions()`: it accepts a dot string (`'edit.approve'`), a `TestAction`, or an array stack of entries where each entry is a string, `TestAction`, or an array that must contain a `'name'` key. Any array entry without `'name'` throws a LogicException naming the offending nesting index before the test interaction runs.","triggerScenarios":"Calling a testing helper like `callAction([...])` or `mountAction([...])` with an array entry such as `['arguments' => ['id' => 1]]` that is missing the `'name'` key (also caused by using the wrong key, e.g. `'action'`).","commonSituations":"Writing Pest/PHPUnit tests for nested mounted modal actions, data-provided test payloads where a record drops the name field, or refactoring a string spec into arrays and forgetting the key.","solutions":["Add a `'name'` key to every array entry: `['name' => 'approve', 'arguments' => [...]]`.","Use a dot string for simple nesting (`'edit.approve'`) or a `TestAction` object instead of raw arrays.","For class-based actions, pass the FQCN — it is resolved through its `ActionName` attribute or `getDefaultName()`."],"exampleFix":"// before\n$this->callAction([['name' => 'edit'], ['arguments' => ['id' => 1]]]);\n\n// after\n$this->callAction([['name' => 'edit'], ['name' => 'approve', 'arguments' => ['id' => 1]]]);","handlingStrategy":"validation","validationCode":"// Normalize before calling a testing helper\n$normalized = array_map(\n    fn (string|array|TestAction $action): array => match (true) {\n        is_string($action) => ['name' => $action],\n        $action instanceof TestAction => $action->toArray(),\n        default => $action,\n    },\n    $actions,\n);\n\nforeach ($normalized as $index => $action) {\n    if (! isset($action['name'])) {\n        throw new InvalidArgumentException(\"Test action at index [{$index}] is missing 'name'.\");\n    }\n}","typeGuard":"function isValidTestActionSpec(mixed $action): bool\n{\n    return is_string($action)\n        || $action instanceof TestAction\n        || (is_array($action) && array_key_exists('name', $action));\n}","tryCatchPattern":"try {\n    $this->callAction($actions);\n} catch (LogicException $exception) {\n    $this->fail('Malformed action spec: ' . $exception->getMessage());\n}","preventionTips":["Prefer dot strings ('edit.approve') for nested action specs — they cannot omit names.","If test payloads are data-provided, assert every entry has a 'name' key in the provider itself.","Remember the key is 'name', not 'action'."],"tags":["filament","testing","actions","pest","phpunit"],"backgroundTag":"invalid-test-action-spec","analyzedSha":"53483fa9340e4ec637985fe454ebb58afb92ea24","analyzedAt":"2026-08-17T02:06:23.049Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}