File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Arifszn \AdvancedValidation \Tests \Rules ;
4+
5+ use Arifszn \AdvancedValidation \Rules \Jwt ;
6+ use Arifszn \AdvancedValidation \Tests \TestCase ;
7+
8+ class JwtTest extends TestCase
9+ {
10+ /**
11+ * @dataProvider provider
12+ */
13+ public function testValidation ($ result , $ value )
14+ {
15+ $ this ->assertEquals ($ result , (new Jwt ())->passes ('foo ' , $ value ));
16+ }
17+
18+ public function provider ()
19+ {
20+ return [
21+ [true , 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb2dnZWRJbkFzIjoiYWRtaW4iLCJpYXQiOjE0MjI3Nzk2Mzh9.gzSraSYS8EXBxLN_oWnFSRgCzcmJmMjLiuyu5CSpyHI ' ],
22+ [true , 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb3JlbSI6Imlwc3VtIn0.ymiJSsMJXR6tMSr8G9usjQ15_8hKPDv_CArLhxw28MI ' ],
23+ [true , 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkb2xvciI6InNpdCIsImFtZXQiOlsibG9yZW0iLCJpcHN1bSJdfQ.rRpe04zbWbbJjwM43VnHzAboDzszJtGrNsUxaqQ-GQ8 ' ],
24+ [true , 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqb2huIjp7ImFnZSI6MjUsImhlaWdodCI6MTg1fSwiamFrZSI6eyJhZ2UiOjMwLCJoZWlnaHQiOjI3MH19.YRLPARDmhGMC3BBk_OhtwwK21PIkVCqQe8ncIRPKo-E ' ],
25+
26+ [false , 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9 ' ],
27+ [false , '$Zs.ewu.su84 ' ],
28+ [false , 'ks64$S/9.dy$§kz.3sd73b ' ],
29+ [false , '' ],
30+ [false , ' ' ],
31+ ];
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments