$roomCalendarRoot->disableListing = $disableListing;
$publicCalendarRoot = new PublicCalendarRoot($caldavBackend, $l10n, $config, $logger);
- $publicCalendarRoot->disableListing = $disableListing;
$systemTagCollection = new SystemTag\SystemTagsByIdCollection(
\OC::$server->getSystemTagManager(),
use OCA\DAV\BackgroundJob\CleanupInvitationTokenJob;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\DB\QueryBuilder\IQueryBuilder;
-use OCP\DB\QueryBuilder\IQueryFunction;
use OCP\IDBConnection;
use Test\TestCase;
class CleanupInvitationTokenJobTest extends TestCase {
-
/** @var IDBConnection | \PHPUnit\Framework\MockObject\MockObject */
private $dbConnection;
[1337, \PDO::PARAM_STR, null, 'namedParameter1337']
]);
- $function = $this->createMock(IQueryFunction::class);
+ $function = 'function1337';
$expr->expects($this->once())
->method('lt')
->with('expiration', 'namedParameter1337')
use OCA\DAV\CalDAV\CalDavBackend;
use OCA\DAV\CardDAV\CardDavBackend;
use OCP\AppFramework\Utility\ITimeFactory;
-use OCP\DB\Exception;
use OCP\IConfig;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
use Test\TestCase;
class PruneOutdatedSyncTokensJobTest extends TestCase {
+ /** @var ITimeFactory | MockObject */
+ private $timeFactory;
/** @var CalDavBackend | MockObject */
private $calDavBackend;
use OCP\IGroupManager;
use OCP\IUser;
use OCP\IUserManager;
-use OCP\IUserSession;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
use Test\TestCase;
class ReminderServiceTest extends TestCase {
-
/** @var Backend|MockObject */
private $backend;
/** @var MockObject|LoggerInterface */
private $logger;
+ /** @var MockObject|Principal */
+ private $principalConnector;
+
public const CALENDAR_DATA = <<<EOD
BEGIN:VCALENDAR
PRODID:-//Nextcloud calendar v1.6.4
use Test\TestCase;
class BackendTest extends TestCase {
-
/** @var IManager|MockObject */
protected $activityManager;
/** @var IAppManager|MockObject */
protected $appManager;
+ /** @var IUserManager|MockObject */
+ protected $userManager;
+
protected function setUp(): void {
parent::setUp();
$this->activityManager = $this->createMock(IManager::class);
use Test\TestCase;
class PrincipalTest extends TestCase {
-
/** @var IUserManager | MockObject */
private $userManager;
$user2->method('getSystemEMailAddress')->willReturn('user2@foo.bar');
$user3 = $this->createMock(IUser::class);
$user3->method('getUID')->willReturn('user3');
- $user2->method('getDisplayName')->willReturn('User 22');
- $user2->method('getSystemEMailAddress')->willReturn('user2@foo.bar123');
+ $user3->method('getDisplayName')->willReturn('User 22');
+ $user3->method('getSystemEMailAddress')->willReturn('user2@foo.bar123');
$user4 = $this->createMock(IUser::class);
$user4->method('getUID')->willReturn('user4');
- $user2->method('getDisplayName')->willReturn('User 222');
- $user2->method('getSystemEMailAddress')->willReturn('user2@foo.bar456');
+ $user4->method('getDisplayName')->willReturn('User 222');
+ $user4->method('getSystemEMailAddress')->willReturn('user2@foo.bar456');
$this->userManager->expects($this->at(0))
->method('searchDisplayName')
use OCP\DB\IResult;
use OCP\DB\QueryBuilder\IExpressionBuilder;
use OCP\DB\QueryBuilder\IQueryBuilder;
-use OCP\DB\QueryBuilder\IQueryFunction;
use OCP\IDBConnection;
use OCP\IRequest;
use Sabre\VObject\ITip\Message;
use Test\TestCase;
class InvitationResponseControllerTest extends TestCase {
-
/** @var InvitationResponseController */
private $controller;
->with(\PDO::FETCH_ASSOC)
->willReturn($return);
- $function = $this->createMock(IQueryFunction::class);
+ $function = 'functionToken';
$expr->expects($this->once())
->method('eq')
->with('token', 'namedParameterToken')
private $federatedShareProvider;
/** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
private $gsConfig;
+ /** @var IInitialState|\PHPUnit\Framework\MockObject\MockObject */
+ private $initialState;
protected function setUp(): void {
parent::setUp();
private static $tempStorage;
+ private string $subsubfolder = '';
+
protected function setUp(): void {
parent::setUp();
$shares = $this->shareManager->getSharedWith(self::TEST_FILES_SHARING_API_USER2, IShare::TYPE_GROUP);
$share = $shares[0];
- $this->assertSame('/test.txt' ,$share->getTarget());
+ $this->assertSame('/test.txt', $share->getTarget());
$this->assertSame(19, $share->getPermissions());
\OC\Files\Filesystem::rename('test.txt', 'new test.txt');
$shares = $this->shareManager->getSharedWith(self::TEST_FILES_SHARING_API_USER2, IShare::TYPE_GROUP);
$share = $shares[0];
- $this->assertSame('/new test.txt' ,$share->getTarget());
+ $this->assertSame('/new test.txt', $share->getTarget());
$this->assertSame(19, $share->getPermissions());
$share->setPermissions(\OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE);
$shares = $this->shareManager->getSharedWith(self::TEST_FILES_SHARING_API_USER2, IShare::TYPE_GROUP);
$share = $shares[0];
- $this->assertSame('/new test.txt' ,$share->getTarget());
+ $this->assertSame('/new test.txt', $share->getTarget());
$this->assertSame(3, $share->getPermissions());
}
use Psr\Log\LoggerInterface;
class GroupsControllerTest extends \Test\TestCase {
-
/** @var IRequest|\PHPUnit\Framework\MockObject\MockObject */
protected $request;
/** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */
protected $userSession;
/** @var IAccountManager|\PHPUnit\Framework\MockObject\MockObject */
protected $accountManager;
+ /** @var IFactory|\PHPUnit\Framework\MockObject\MockObject */
+ protected $l10nFactory;
/** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */
protected $logger;
/** @var SubAdmin|\PHPUnit\Framework\MockObject\MockObject */
private $urlGenerator;
/** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */
private $l10n;
+ /** @var IFactory|\PHPUnit\Framework\MockObject\MockObject */
+ private $l10nFactory;
/** @var IMailer|\PHPUnit\Framework\MockObject\MockObject */
private $mailer;
/** @var ISecureRandom|\PHPUnit\Framework\MockObject\MockObject */
Install Client: https://nextcloud.com/install/#install-clients
---
+--
TestCloud
This is an automatically sent email, please do not reply.
EOF;
Install Client: https://nextcloud.com/install/#install-clients
---
+--
TestCloud
This is an automatically sent email, please do not reply.
EOF;
Install Client: https://nextcloud.com/install/#install-clients
---
+--
TestCloud
This is an automatically sent email, please do not reply.
EOF;
private ThemesService $themesService;
private IInitialState $initialStateService;
private ThemingDefaults $themingDefaults;
+ private Personal $admin;
/** @var ITheme[] */
private $themes;
$themingDefaults->expects($this->any())
->method('getColorPrimary')
->willReturn('#0082c9');
-
+
$themingDefaults->expects($this->any())
->method('getDefaultColorPrimary')
->willReturn('#0082c9');
use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
-
class DyslexiaFontTest extends TestCase {
/** @var ThemingDefaults|MockObject */
private $themingDefaults;
+ /** @var IUserSession|MockObject */
+ private $userSession;
/** @var IURLGenerator|MockObject */
private $urlGenerator;
/** @var ImageManager|MockObject */
* @package OC\User
*/
class Session implements IUserSession, Emitter {
-
/** @var Manager $manager */
private $manager;
// Try to login with this username and password
if (!$this->login($user, $password)) {
-
// Failed, maybe the user used their email address
if (!filter_var($user, FILTER_VALIDATE_EMAIL)) {
return false;
// User does not exist
return false;
}
- $name = isset($request->server['HTTP_USER_AGENT']) ? utf8_encode($request->server['HTTP_USER_AGENT']) : 'unknown browser';
+ $name = isset($request->server['HTTP_USER_AGENT']) ? mb_convert_encoding($request->server['HTTP_USER_AGENT'], 'UTF-8', 'ISO-8859-1') : 'unknown browser';
try {
$sessionId = $this->session->getId();
$pwd = $this->getPassword($password);
use OCP\Files\IRootFolder;
use OCP\IUserManager;
+use PHPUnit\Framework\MockObject\MockObject;
/**
* Class ShareTest
* @package Test\Share20
*/
class ShareTest extends \Test\TestCase {
-
- /** @var IRootFolder|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IRootFolder|MockObject */
protected $rootFolder;
+ /** @var IUserManager|MockObject */
+ protected $userManager;
/** @var \OCP\Share\IShare */
protected $share;