diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2023-09-02 14:16:01 +0200 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2023-09-06 05:43:21 +0200 |
commit | 9a179c391e5454dba227e1acb8be791660b58be7 (patch) | |
tree | 63fdc92d8e2ffe84bd5e3c6e83432ea05c61cfe6 /tests/lib | |
parent | db5dbd1d56ca9b667198bb321cf266180e1d1fc9 (diff) | |
download | nextcloud-server-9a179c391e5454dba227e1acb8be791660b58be7.tar.gz nextcloud-server-9a179c391e5454dba227e1acb8be791660b58be7.zip |
Print log message when version could not be got from updater server
This could help to diagnose why the updater server could not be reached,
as well as other subtler issues like requests taking too long if the
updater server was tried to be connected to as a "side effect" (for
example, when the "updatenotification" app boots).
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/Updater/VersionCheckTest.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/lib/Updater/VersionCheckTest.php b/tests/lib/Updater/VersionCheckTest.php index be847253035..0f073abc3ce 100644 --- a/tests/lib/Updater/VersionCheckTest.php +++ b/tests/lib/Updater/VersionCheckTest.php @@ -28,6 +28,7 @@ use OCP\IConfig; use OCP\IUserManager; use OCP\Support\Subscription\IRegistry; use OCP\Util; +use Psr\Log\LoggerInterface; class VersionCheckTest extends \Test\TestCase { /** @var IConfig| \PHPUnit\Framework\MockObject\MockObject */ @@ -36,6 +37,8 @@ class VersionCheckTest extends \Test\TestCase { private $updater; /** @var IRegistry | \PHPUnit\Framework\Mo2ckObject\MockObject*/ private $registry; + /** @var LoggerInterface | \PHPUnit\Framework\Mo2ckObject\MockObject*/ + private $logger; protected function setUp(): void { parent::setUp(); @@ -50,6 +53,7 @@ class VersionCheckTest extends \Test\TestCase { $this->registry ->method('delegateHasValidSubscription') ->willReturn(false); + $this->logger = $this->createMock(LoggerInterface::class); $this->updater = $this->getMockBuilder(VersionCheck::class) ->setMethods(['getUrlContent']) ->setConstructorArgs([ @@ -57,6 +61,7 @@ class VersionCheckTest extends \Test\TestCase { $this->config, $this->createMock(IUserManager::class), $this->registry, + $this->logger, ]) ->getMock(); } |