This repository was archived by the owner on Jan 29, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * @see https://github.com/zendframework/zend-expressive-authentication for the canonical source repository
4
+ * @copyright Copyright (c) 2018 Zend Technologies USA Inc. (https://www.zend.com)
5
+ * @license https://github.com/zendframework/zend-expressive-authentication/blob/master/LICENSE.md New BSD License
6
+ */
7
+
8
+ declare (strict_types=1 );
9
+
10
+ namespace ZendTest \Expressive \Authentication ;
11
+
12
+ use PHPUnit \Framework \TestCase ;
13
+ use Zend \Expressive \Authentication \DefaultUser ;
14
+ use Zend \Expressive \Authentication \UserInterface ;
15
+
16
+ class DefaultUserTest extends TestCase
17
+ {
18
+ public function testConstructor ()
19
+ {
20
+ $ user = new DefaultUser ();
21
+ $ this ->assertInstanceOf (UserInterface::class, $ user );
22
+ }
23
+
24
+ public function testSetGetIdentity ()
25
+ {
26
+ $ user = new DefaultUser ();
27
+ $ user ->setIdentity ('foo ' );
28
+ $ this ->assertEquals ('foo ' , $ user ->getIdentity ());
29
+ }
30
+
31
+ public function testSetGetRoles ()
32
+ {
33
+ $ user = new DefaultUser ();
34
+ $ user ->setRoles (['foo ' , 'bar ' ]);
35
+ $ this ->assertEquals (['foo ' , 'bar ' ], $ user ->getRoles ());
36
+ }
37
+ }
You can’t perform that action at this time.
0 commit comments