diff --git a/src/Util/Common.php b/src/Util/Common.php index e1acf04589..4f78cb532f 100644 --- a/src/Util/Common.php +++ b/src/Util/Common.php @@ -91,11 +91,7 @@ abstract class Common public static function userNickname(): ?string { - if (($user = self::user()) == null) { - throw new NoLoggedInUser(); - } else { - return $user->getNickname(); - } + self::ensureLoggedIn()->getNickname(); } public function getAllNotes(int $noteScope): array diff --git a/tests/Core/CacheTest.php b/tests/Core/CacheTest.php index dd0e6aef13..cb8c80e222 100644 --- a/tests/Core/CacheTest.php +++ b/tests/Core/CacheTest.php @@ -33,7 +33,7 @@ class CacheTest extends KernelTestCase static::bootKernel(); // Setup Common::config to have the values in $conf - $conf = ['cache' => ['adapters' => $adapters]]; + $conf = ['cache' => ['adapters' => $adapters, 'early_recompute' => INF]]; $cb = $this->createMock(ContainerBagInterface::class); static::assertTrue($cb instanceof ContainerBagInterface); $cb->method('get')