18 $this->assertTrue( $userinfo->isAnon() );
19 $this->assertTrue( $userinfo->isVerified() );
20 $this->assertSame( 0, $userinfo->getId() );
21 $this->assertSame(
null, $userinfo->getName() );
22 $this->assertSame(
'', $userinfo->getToken() );
23 $this->assertNotNull( $userinfo->getUser() );
24 $this->assertSame( $userinfo, $userinfo->verified() );
25 $this->assertSame(
'<anon>', (
string)$userinfo );
32 $this->fail(
'Expected exception not thrown' );
33 }
catch ( \InvalidArgumentException $ex ) {
34 $this->assertSame(
'Invalid ID', $ex->getMessage() );
39 $this->assertFalse( $userinfo->isAnon() );
40 $this->assertFalse( $userinfo->isVerified() );
41 $this->assertSame( $user->getId(), $userinfo->getId() );
42 $this->assertSame( $user->getName(), $userinfo->getName() );
43 $this->assertSame( $user->getToken(
true ), $userinfo->getToken() );
44 $this->assertInstanceOf( User::class, $userinfo->getUser() );
45 $userinfo2 = $userinfo->verified();
46 $this->assertNotSame( $userinfo2, $userinfo );
47 $this->assertSame(
"<-:{$user->getId()}:{$user->getName()}>", (
string)$userinfo );
49 $this->assertFalse( $userinfo2->isAnon() );
50 $this->assertTrue( $userinfo2->isVerified() );
51 $this->assertSame( $user->getId(), $userinfo2->getId() );
52 $this->assertSame( $user->getName(), $userinfo2->getName() );
53 $this->assertSame( $user->getToken(
true ), $userinfo2->getToken() );
54 $this->assertInstanceOf( User::class, $userinfo2->getUser() );
55 $this->assertSame( $userinfo2, $userinfo2->verified() );
56 $this->assertSame(
"<+:{$user->getId()}:{$user->getName()}>", (
string)$userinfo2 );
59 $this->assertTrue( $userinfo->isVerified() );
60 $this->assertSame( $userinfo, $userinfo->verified() );
66 $this->fail(
'Expected exception not thrown' );
67 }
catch ( \InvalidArgumentException $ex ) {
68 $this->assertSame(
'Invalid user name', $ex->getMessage() );
74 $this->assertFalse( $userinfo->isAnon() );
75 $this->assertFalse( $userinfo->isVerified() );
76 $this->assertSame( $user->getId(), $userinfo->getId() );
77 $this->assertSame( $user->getName(), $userinfo->getName() );
78 $this->assertSame( $user->getToken(
true ), $userinfo->getToken() );
79 $this->assertInstanceOf( User::class, $userinfo->getUser() );
80 $userinfo2 = $userinfo->verified();
81 $this->assertNotSame( $userinfo2, $userinfo );
82 $this->assertSame(
"<-:{$user->getId()}:{$user->getName()}>", (
string)$userinfo );
84 $this->assertFalse( $userinfo2->isAnon() );
85 $this->assertTrue( $userinfo2->isVerified() );
86 $this->assertSame( $user->getId(), $userinfo2->getId() );
87 $this->assertSame( $user->getName(), $userinfo2->getName() );
88 $this->assertSame( $user->getToken(
true ), $userinfo2->getToken() );
89 $this->assertInstanceOf( User::class, $userinfo2->getUser() );
90 $this->assertSame( $userinfo2, $userinfo2->verified() );
91 $this->assertSame(
"<+:{$user->getId()}:{$user->getName()}>", (
string)$userinfo2 );
94 $this->assertTrue( $userinfo->isVerified() );
95 $this->assertSame( $userinfo, $userinfo->verified() );
99 $this->assertSame( 0, $user->getId(),
'sanity check' );
101 $this->assertFalse( $userinfo->isAnon() );
102 $this->assertFalse( $userinfo->isVerified() );
103 $this->assertSame( $user->getId(), $userinfo->getId() );
104 $this->assertSame( $user->getName(), $userinfo->getName() );
105 $this->assertSame(
'', $userinfo->getToken() );
106 $this->assertInstanceOf( User::class, $userinfo->getUser() );
107 $userinfo2 = $userinfo->verified();
108 $this->assertNotSame( $userinfo2, $userinfo );
109 $this->assertSame(
"<-:{$user->getId()}:{$user->getName()}>", (
string)$userinfo );
111 $this->assertFalse( $userinfo2->isAnon() );
112 $this->assertTrue( $userinfo2->isVerified() );
113 $this->assertSame( $user->getId(), $userinfo2->getId() );
114 $this->assertSame( $user->getName(), $userinfo2->getName() );
115 $this->assertSame(
'', $userinfo2->getToken() );
116 $this->assertInstanceOf( User::class, $userinfo2->getUser() );
117 $this->assertSame( $userinfo2, $userinfo2->verified() );
118 $this->assertSame(
"<+:{$user->getId()}:{$user->getName()}>", (
string)$userinfo2 );
121 $this->assertTrue( $userinfo->isVerified() );
122 $this->assertSame( $userinfo, $userinfo->verified() );
129 $this->assertFalse( $userinfo->isAnon() );
130 $this->assertFalse( $userinfo->isVerified() );
131 $this->assertSame( $user->getId(), $userinfo->getId() );
132 $this->assertSame( $user->getName(), $userinfo->getName() );
133 $this->assertSame( $user->getToken(
true ), $userinfo->getToken() );
134 $this->assertSame( $user, $userinfo->getUser() );
135 $userinfo2 = $userinfo->verified();
136 $this->assertNotSame( $userinfo2, $userinfo );
137 $this->assertSame(
"<-:{$user->getId()}:{$user->getName()}>", (
string)$userinfo );
139 $this->assertFalse( $userinfo2->isAnon() );
140 $this->assertTrue( $userinfo2->isVerified() );
141 $this->assertSame( $user->getId(), $userinfo2->getId() );
142 $this->assertSame( $user->getName(), $userinfo2->getName() );
143 $this->assertSame( $user->getToken(
true ), $userinfo2->getToken() );
144 $this->assertSame( $user, $userinfo2->getUser() );
145 $this->assertSame( $userinfo2, $userinfo2->verified() );
146 $this->assertSame(
"<+:{$user->getId()}:{$user->getName()}>", (
string)$userinfo2 );
149 $this->assertTrue( $userinfo->isVerified() );
150 $this->assertSame( $userinfo, $userinfo->verified() );
154 $this->assertSame( 0, $user->getId(),
'sanity check' );
156 $this->assertFalse( $userinfo->isAnon() );
157 $this->assertFalse( $userinfo->isVerified() );
158 $this->assertSame( $user->getId(), $userinfo->getId() );
159 $this->assertSame( $user->getName(), $userinfo->getName() );
160 $this->assertSame(
'', $userinfo->getToken() );
161 $this->assertSame( $user, $userinfo->getUser() );
162 $userinfo2 = $userinfo->verified();
163 $this->assertNotSame( $userinfo2, $userinfo );
164 $this->assertSame(
"<-:{$user->getId()}:{$user->getName()}>", (
string)$userinfo );
166 $this->assertFalse( $userinfo2->isAnon() );
167 $this->assertTrue( $userinfo2->isVerified() );
168 $this->assertSame( $user->getId(), $userinfo2->getId() );
169 $this->assertSame( $user->getName(), $userinfo2->getName() );
170 $this->assertSame(
'', $userinfo2->getToken() );
171 $this->assertSame( $user, $userinfo2->getUser() );
172 $this->assertSame( $userinfo2, $userinfo2->verified() );
173 $this->assertSame(
"<+:{$user->getId()}:{$user->getName()}>", (
string)$userinfo2 );
176 $this->assertTrue( $userinfo->isVerified() );
177 $this->assertSame( $userinfo, $userinfo->verified() );
181 $this->assertTrue( $userinfo->isVerified() );
182 $this->assertSame( 0, $userinfo->getId() );
183 $this->assertSame(
null, $userinfo->getName() );