@@ 41-50 (lines=10) @@ | ||
38 | static::assertFalse($manager->isAuthenticated()); |
|
39 | } |
|
40 | ||
41 | public function testGetUsername(): void |
|
42 | { |
|
43 | $session = $this->prophesize(Session::class); |
|
44 | $session->get('_CORE23_LASTFM_NAME') |
|
45 | ->willReturn('MyUser') |
|
46 | ; |
|
47 | ||
48 | $manager = new SessionManager($session->reveal()); |
|
49 | static::assertSame('MyUser', $manager->getUsername()); |
|
50 | } |
|
51 | ||
52 | public function testGetUsernameNotExist(): void |
|
53 | { |
|
@@ 75-83 (lines=9) @@ | ||
72 | $manager->store($lastfmSession); |
|
73 | } |
|
74 | ||
75 | public function testClear(): void |
|
76 | { |
|
77 | $session = $this->prophesize(Session::class); |
|
78 | $session->remove('_CORE23_LASTFM_TOKEN')->shouldBeCalled(); |
|
79 | $session->remove('_CORE23_LASTFM_NAME')->shouldBeCalled(); |
|
80 | ||
81 | $manager = new SessionManager($session->reveal()); |
|
82 | $manager->clear(); |
|
83 | } |
|
84 | ||
85 | public function testGetSession(): void |
|
86 | { |