File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6666- [v] Util
6767- [v] PasswordValidator
6868- [v] User
69+ - [v] Middleware
70+ - [v] Session
6971- [ ] Mailer
7072- [ ] MailTemplateGenerator
7173- [ ] MailTemplates
7274- [ ] Server
7375- [ ] StorageServer
74- - [-] Session
7576- [-] SolidNotifications
7677- [-] SolidPubSub
77- - [-] Middleware
7878- [-] Db
Original file line number Diff line number Diff line change 1+ <?php
2+ namespace Pdsinterop \PhpSolid ;
3+
4+ use Pdsinterop \PhpSolid \Session ;
5+
6+ function session_start ($ options =[]) {
7+ SessionTest::$ sessionOptions = $ options ;
8+ }
9+
10+ class SessionTest extends \PHPUnit \Framework \TestCase
11+ {
12+ public static $ sessionOptions = [];
13+ public function testStart () {
14+ Session::start ("alice " );
15+ $ this ->assertEquals ($ _SESSION ['username ' ], "alice " );
16+ $ this ->assertEquals (self ::$ sessionOptions , ['cookie_lifetime ' => 86400 ]);
17+ }
18+
19+ public function testGetLoggedInUser () {
20+ Session::start ("alice " );
21+ $ user = Session::getLoggedInUser ();
22+ $ this ->assertEquals ($ user , "alice " );
23+ }
24+ }
You can’t perform that action at this time.
0 commit comments