. */ declare(strict_types=1); namespace Fisharebest\Webtrees; use Fisharebest\Webtrees\Contracts\UserInterface; use PHPUnit\Framework\Attributes\CoversClass; #[CoversClass(NoReplyUser::class)] class NoReplyUserTest extends TestCase { protected static bool $uses_database = true; public function testConstructor(): void { $user = new NoReplyUser(); self::assertInstanceOf(UserInterface::class, $user); self::assertSame(0, $user->id()); self::assertSame('no-reply@localhost', $user->email()); self::assertSame(Webtrees::NAME, $user->realName()); self::assertSame('', $user->userName()); } public function testPreferences(): void { $user = new NoReplyUser(); self::assertSame('', $user->getPreference('foo')); self::assertSame('', $user->getPreference('foo')); self::assertSame('bar', $user->getPreference('foo', 'bar')); // No reply users do not have preferences $user->setPreference('foo', 'bar'); self::assertSame('', $user->getPreference('foo')); } }