Lines Matching refs:user
47 $user = new User(123, 'username', 'real name', 'email');
49 self::assertInstanceOf(UserInterface::class, $user);
50 self::assertSame(123, $user->id());
51 self::assertSame('email', $user->email());
52 self::assertSame('real name', $user->realName());
53 self::assertSame('username', $user->userName());
59 $user = $user_service->create('user', 'User', 'user@example.com', 'secret');
61 self::assertSame(1, $user->id());
63 self::assertSame('user', $user->userName());
64 $user->setUserName('foo');
65 self::assertSame('foo', $user->userName());
67 self::assertSame('User', $user->realName());
68 $user->setRealName('Foo');
69 self::assertSame('Foo', $user->realName());
71 self::assertSame('user@example.com', $user->email());
72 $user->setEmail('foo@example.com');
73 self::assertSame('foo@example.com', $user->email());
75 self::assertTrue($user->checkPassword('secret'));
76 $user->setPassword('letmein');
77 self::assertTrue($user->checkPassword('letmein'));
83 $user = $user_service->create('user', 'User', 'user@example.com', 'secret');
85 self::assertSame('', $user->getPreference('foo'));
86 $user->setPreference('foo', 'bar');
87 self::assertSame('bar', $user->getPreference('foo'));