Skip to content

Commit 2ad0864

Browse files
committed
test: add test cases for except
1 parent f9ecd03 commit 2ad0864

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

tests/system/Filters/FiltersTest.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,52 @@ public static function provideBeforeExcept(): iterable
646646
'after' => ['baz'],
647647
],
648648
],
649+
'empty string not exclude' => [
650+
'admin/foo/bar',
651+
// The URI path '' means the baseURL.
652+
'',
653+
[
654+
'before' => [
655+
'foo',
656+
'bar',
657+
],
658+
'after' => ['baz'],
659+
],
660+
],
661+
'empty string exclude' => [
662+
// The URI path '' means the baseURL.
663+
'',
664+
// So this setting excludes `foo` filter only to the baseURL.
665+
'',
666+
[
667+
'before' => [
668+
'bar',
669+
],
670+
'after' => ['baz'],
671+
],
672+
],
673+
'slash not exclude' => [
674+
'admin/foo/bar',
675+
'/',
676+
[
677+
'before' => [
678+
'foo',
679+
'bar',
680+
],
681+
'after' => ['baz'],
682+
],
683+
],
684+
'slash exclude' => [
685+
// The URI path '' means the baseURL.
686+
'',
687+
'/',
688+
[
689+
'before' => [
690+
'bar',
691+
],
692+
'after' => ['baz'],
693+
],
694+
],
649695
];
650696
}
651697

0 commit comments

Comments
 (0)