File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace CodingSocks \UploadHandler \Tests ;
4+
5+ use CodingSocks \UploadHandler \Identifier \AuthIdentifier ;
6+ use CodingSocks \UploadHandler \Identifier \NopIdentifier ;
7+ use CodingSocks \UploadHandler \Identifier \SessionIdentifier ;
8+ use CodingSocks \UploadHandler \IdentityManager ;
9+
10+ class IdentityManagerTest extends TestCase
11+ {
12+ /**
13+ * @var IdentityManager
14+ */
15+ private $ manager ;
16+
17+ /**
18+ * {@inheritDoc}
19+ */
20+ protected function setUp (): void
21+ {
22+ parent ::setUp ();
23+
24+ $ this ->manager = new IdentityManager ($ this ->app );
25+ }
26+
27+ public function availableDrivers ()
28+ {
29+ return [
30+ 'auth ' => ['auth ' , AuthIdentifier::class],
31+ 'nop ' => ['nop ' , NopIdentifier::class],
32+ 'session ' => ['session ' , SessionIdentifier::class],
33+ ];
34+ }
35+
36+ /**
37+ * @dataProvider availableDrivers
38+ */
39+ public function testDriverCreation ($ driverName , $ expectedInstanceOf )
40+ {
41+ $ driver = $ this ->manager ->driver ($ driverName );
42+ $ this ->assertInstanceOf ($ expectedInstanceOf , $ driver );
43+ }
44+
45+ public function testDefaultDriver ()
46+ {
47+ $ driver = $ this ->manager ->driver ();
48+ $ this ->assertInstanceOf (SessionIdentifier::class, $ driver );
49+ }
50+ }
You can’t perform that action at this time.
0 commit comments