- Issue created by @plopesc
- Merge request !9Issue #3540450: 3535052 Deprecated function: ctype_digit() → (Open) created by plopesc
- First commit to issue fork.
- 🇳🇮Nicaragua jeremy1606
I have added a kernel test to validate the fix applied in UrlPath.php, where the original condition was modified to avoid a deprecation warning when calling ctype_digit() with a NULL value. The new conditional first checks that $lastSegment is not empty before applying ctype_digit(), which resolves the reported issue when accessing a view such as /foo without the arg_0 parameter. To ensure that the plugin behaves correctly in all scenarios, I created the file tests/src/Kernel/NullUrlPathArgumentTest.php with two tests: testNullLastSegment, which simulates a path with arg_0 = NULL and confirms that the plugin returns an empty string without errors; and testNumericSegment, which verifies that a numeric argument such as ‘123’ is handled correctly and returned as is. Both tests pass successfully and confirm that the plugin now works safely and robustly. If further work is needed, I welcome comments and suggestions.
- heddn Nicaragua
The test only changes didn't fail. So that means it isn't testing the issue or it would fail. NW