File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Tests \Unit ;
6+
7+ use CodeIgniter \Filters \FilterInterface ;
8+ use CodeIgniter \HTTP \CLIRequest ;
9+ use CodeIgniter \Shield \Filters \AuthRates ;
10+ use CodeIgniter \Shield \Filters \ChainAuth ;
11+ use CodeIgniter \Shield \Filters \SessionAuth ;
12+ use CodeIgniter \Shield \Filters \TokenAuth ;
13+ use Generator ;
14+ use Tests \Support \TestCase ;
15+
16+ /**
17+ * @internal
18+ */
19+ final class FilterInCliTest extends TestCase
20+ {
21+ /**
22+ * @dataProvider filterProvider
23+ */
24+ public function testWhenInCliDoNothing (FilterInterface $ filter ): void
25+ {
26+ $ clirequest = $ this ->createMock (CLIRequest::class);
27+
28+ $ clirequest ->expects ($ this ->never ())
29+ ->method ('getHeaderLine ' );
30+
31+ $ filter ->before ($ clirequest );
32+ }
33+
34+ public function filterProvider (): Generator
35+ {
36+ yield from [
37+ [new AuthRates ()],
38+ [new ChainAuth ()],
39+ [new SessionAuth ()],
40+ [new TokenAuth ()],
41+ ];
42+ }
43+ }
You can’t perform that action at this time.
0 commit comments