public function setUp() {
parent::setUp();
- $this->l = $this->createMock('\OCP\IL10N');
- $this->logger = $this->createMock('\OCP\ILogger');
- $this->userSession = $this->createMock('\OCP\IUserSession');
- $this->config = $this->createMock('\OCP\IConfig');
- $this->userManager = $this->createMock('\OCP\IUserManager');
- $this->session = $this->createMock('\OCP\ISession');
+ $this->l = $this->getMockBuilder('\OCP\IL10N')->getMock();
+ $this->logger = $this->getMockBuilder('\OCP\ILogger')->getMock();
+ $this->userSession = $this->getMockBuilder('\OCP\IUserSession')->getMock();
+ $this->config = $this->getMockBuilder('\OCP\IConfig')->getMock();
+ $this->userManager = $this->getMockBuilder('\OCP\IUserManager')->getMock();
+ $this->session = $this->getMockBuilder('\OCP\ISession')->getMock();
$this->admin = new Admin(
$this->l,
public function setUp() {
parent::setUp();
- $this->federatedShareProvider = $this->createMock('\OCA\FederatedFileSharing\FederatedShareProvider');
+ $this->federatedShareProvider = $this->getMockBuilder('\OCA\FederatedFileSharing\FederatedShareProvider')->disableOriginalConstructor()->getMock();
$this->admin = new Admin(
$this->federatedShareProvider
);
public function setUp() {
parent::setUp();
- $this->trustedServers = $this->createMock('\OCA\Federation\TrustedServers');
+ $this->trustedServers = $this->getMockBuilder('\OCA\Federation\TrustedServers')->disableOriginalConstructor()->getMock();
$this->admin = new Admin(
$this->trustedServers
);
public function setUp() {
parent::setUp();
- $this->iniGetWrapper = $this->createMock('\bantu\IniGetWrapper\IniGetWrapper');
- $this->request = $this->createMock('\OCP\IRequest');
+ $this->iniGetWrapper = $this->getMockBuilder('\bantu\IniGetWrapper\IniGetWrapper')->disableOriginalConstructor()->getMock();
+ $this->request = $this->getMockBuilder('\OCP\IRequest')->getMock();
$this->admin = new Admin(
$this->iniGetWrapper,
$this->request
public function setUp() {
parent::setUp();
- $this->encryptionManager = $this->createMock('\OCP\Encryption\IManager');
- $this->globalStoragesService = $this->createMock('\OCA\Files_External\Service\GlobalStoragesService');
- $this->backendService = $this->createMock('\OCA\Files_External\Service\BackendService');
- $this->globalAuth = $this->createMock('\OCA\Files_External\Lib\Auth\Password\GlobalAuth');
+ $this->encryptionManager = $this->getMockBuilder('\OCP\Encryption\IManager')->getMock();
+ $this->globalStoragesService = $this->getMockBuilder('\OCA\Files_External\Service\GlobalStoragesService')->disableOriginalConstructor()->getMock();
+ $this->backendService = $this->getMockBuilder('\OCA\Files_External\Service\BackendService')->disableOriginalConstructor()->getMock();
+ $this->globalAuth = $this->getMockBuilder('\OCA\Files_External\Lib\Auth\Password\GlobalAuth')->disableOriginalConstructor()->getMock();
$this->admin = new Admin(
$this->encryptionManager,
public function setUp() {
parent::setUp();
- $this->l = $this->createMock('\OCP\IL10N');
+ $this->l = $this->getMockBuilder('\OCP\IL10N')->disableOriginalConstructor()->getMock();
$this->section = new Section(
$this->l
public function setUp() {
parent::setUp();
- $this->config = $this->createMock('\OCP\IConfig');
- $this->l10n = $this->createMock('\OCP\IL10N');
- $this->themingDefaults = $this->createMock('\OCA\Theming\ThemingDefaults');
- $this->urlGenerator = $this->createMock('\OCP\IURLGenerator');
+ $this->config = $this->getMockBuilder('\OCP\IConfig')->getMock();
+ $this->l10n = $this->getMockBuilder('\OCP\IL10N')->getMock();
+ $this->themingDefaults = $this->getMockBuilder('\OCA\Theming\ThemingDefaults')->disableOriginalConstructor()->getMock();
+ $this->urlGenerator = $this->getMockBuilder('\OCP\IURLGenerator')->getMock();
$this->admin = new Admin(
$this->config,
public function setUp() {
parent::setUp();
- $this->l = $this->createMock('\OCP\IL10N');
+ $this->l = $this->getMockBuilder('\OCP\IL10N')->getMock();
$this->section = new Section(
$this->l
public function setUp() {
parent::setUp();
- $this->request = $this->createMock('\\OCP\\IRequest');
- $this->jobList = $this->createMock('\\OCP\\BackgroundJob\\IJobList');
- $this->secureRandom = $this->createMock('\\OCP\\Security\\ISecureRandom');
- $this->config = $this->createMock('\\OCP\\IConfig');
- $this->timeFactory = $this->createMock('\\OCP\\AppFramework\\Utility\\ITimeFactory');
- $this->l10n = $this->createMock('\\OCP\\IL10N');
- $this->updateChecker = $this->createMock('\\OCA\\UpdateNotification\\UpdateChecker');
- $this->dateTimeFormatter = $this->createMock('\\OCP\\IDateTimeFormatter');
+ $this->request = $this->getMockBuilder('\\OCP\\IRequest')->getMock();
+ $this->jobList = $this->getMockBuilder('\\OCP\\BackgroundJob\\IJobList')->getMock();
+ $this->secureRandom = $this->getMockBuilder('\\OCP\\Security\\ISecureRandom')->getMock();
+ $this->config = $this->getMockBuilder('\\OCP\\IConfig')->getMock();
+ $this->timeFactory = $this->getMockBuilder('\\OCP\\AppFramework\\Utility\\ITimeFactory')->getMock();
+ $this->l10n = $this->getMockBuilder('\\OCP\\IL10N')->getMock();
+ $this->updateChecker = $this->getMockBuilder('\\OCA\\UpdateNotification\\UpdateChecker')->disableOriginalConstructor()->getMock();
+ $this->dateTimeFormatter = $this->getMockBuilder('\\OCP\\IDateTimeFormatter')->getMock();
$this->adminController = new AdminController(
'updatenotification',
public function setUp() {
parent::setUp();
- $this->l10n = $this->createMock('\OCP\IL10N');
+ $this->l10n = $this->getMockBuilder('\OCP\IL10N')->getMock();
$this->admin = new Admin(
$this->l10n
public function setUp() {
parent::setUp();
- $this->l = $this->createMock('\OCP\IL10N');
+ $this->l = $this->getMockBuilder('\OCP\IL10N')->getMock();
$this->section = new Section(
$this->l
public function setUp() {
parent::setUp();
- $this->request = $this->createMock('\OCP\IRequest');
- $this->navigationManager = $this->createMock('\OCP\INavigationManager');
- $this->settingsManager = $this->createMock('\OCP\Settings\IManager');
+ $this->request = $this->getMockBuilder('\OCP\IRequest')->getMock();
+ $this->navigationManager = $this->getMockBuilder('\OCP\INavigationManager')->getMock();
+ $this->settingsManager = $this->getMockBuilder('\OCP\Settings\IManager')->getMock();
$this->adminSettingsController = new AdminSettingsController(
'settings',
->expects($this->once())
->method('getAdminSettings')
->with('test')
- ->willReturn([5 => new TipsTricks($this->createMock('\OCP\IConfig'))]);
+ ->willReturn([5 => new TipsTricks($this->getMockBuilder('\OCP\IConfig')->getMock())]);
$expected = new TemplateResponse('settings', 'admin/frame', ['forms' => [], 'content' => '']);
$this->assertEquals($expected, $this->adminSettingsController->index('test'));
}
}));
$this->checker = $this->getMockBuilder('\OC\IntegrityCheck\Checker')
->disableOriginalConstructor()->getMock();
- $this->logger = $this->createMock('\OCP\ILogger');
+ $this->logger = $this->getMockBuilder('\OCP\ILogger')->getMock();
$this->checkSetupController = $this->getMockBuilder('\OC\Settings\Controller\CheckSetupController')
->setConstructorArgs([
'settings',
public function setUp() {
parent::setUp();
- $this->config = $this->createMock('\OCP\IConfig');
+ $this->config = $this->getMockBuilder('\OCP\IConfig')->getMock();
$this->admin = new Additional(
$this->config
public function setUp() {
parent::setUp();
- $this->manager = $this->createMock('\OC\Encryption\Manager');
- $this->userManager = $this->createMock('\OCP\IUserManager');
+ $this->manager = $this->getMockBuilder('\OC\Encryption\Manager')->disableOriginalConstructor()->getMock();
+ $this->userManager = $this->getMockBuilder('\OCP\IUserManager')->getMock();
$this->admin = new Encryption(
$this->manager,
public function setUp() {
parent::setUp();
- $this->config = $this->createMock('\OCP\IConfig');
+ $this->config = $this->getMockBuilder('\OCP\IConfig')->getMock();
$this->admin = new Logging(
$this->config
public function setUp() {
parent::setUp();
- $this->config = $this->createMock('\OCP\IConfig');
- $this->dbConnection = $this->createMock('\OCP\IDBConnection');
- $this->lockingProvider = $this->createMock('\OCP\Lock\ILockingProvider');
- $this->l10n = $this->createMock('\OCP\IL10N');
+ $this->config = $this->getMockBuilder('\OCP\IConfig')->getMock();
+ $this->dbConnection = $this->getMockBuilder('\OCP\IDBConnection')->getMock();
+ $this->lockingProvider = $this->getMockBuilder('\OCP\Lock\ILockingProvider')->getMock();
+ $this->l10n = $this->getMockBuilder('\OCP\IL10N')->getMock();
$this->admin = new Server(
$this->dbConnection,
public function setUp() {
parent::setUp();
- $this->config = $this->createMock('\OCP\IConfig');
+ $this->config = $this->getMockBuilder('\OCP\IConfig')->getMock();
$this->admin = new Sharing(
$this->config
public function setUp() {
parent::setUp();
- $this->config = $this->createMock('\OCP\IConfig');
+ $this->config = $this->getMockBuilder('\OCP\IConfig')->getMock();
$this->admin = new TipsTricks(
$this->config
public function setUp() {
parent::setUp();
- $this->logger = $this->createMock('\OCP\ILogger');
- $this->dbConnection = $this->createMock('\OCP\IDBConnection');
- $this->l10n = $this->createMock('\OCP\IL10N');
- $this->config = $this->createMock('\OCP\IConfig');
- $this->encryptionManager = $this->createMock('\OCP\Encryption\IManager');
- $this->userManager = $this->createMock('\OCP\IUserManager');
- $this->lockingProvider = $this->createMock('\OCP\Lock\ILockingProvider');
+ $this->logger = $this->getMockBuilder('\OCP\ILogger')->getMock();
+ $this->dbConnection = $this->getMockBuilder('\OCP\IDBConnection')->getMock();
+ $this->l10n = $this->getMockBuilder('\OCP\IL10N')->getMock();
+ $this->config = $this->getMockBuilder('\OCP\IConfig')->getMock();
+ $this->encryptionManager = $this->getMockBuilder('\OCP\Encryption\IManager')->getMock();
+ $this->userManager = $this->getMockBuilder('\OCP\IUserManager')->getMock();
+ $this->lockingProvider = $this->getMockBuilder('\OCP\Lock\ILockingProvider')->getMock();
$this->manager = new Manager(
$this->logger,
}
public function testSetupSettings() {
- $qb = $this->createMock('\OCP\DB\QueryBuilder\IQueryBuilder');
+ $qb = $this->getMockBuilder('\OCP\DB\QueryBuilder\IQueryBuilder')->getMock();
$qb
->expects($this->once())
->method('select')
->method('from')
->with('admin_settings')
->willReturn($qb);
- $expressionBuilder = $this->createMock('\OCP\DB\QueryBuilder\IExpressionBuilder');
+ $expressionBuilder = $this->getMockBuilder('\OCP\DB\QueryBuilder\IExpressionBuilder')->getMock();
$qb
->expects($this->once())
->method('expr')
->willReturn($expressionBuilder);
- $param = $this->createMock('\OCP\DB\QueryBuilder\IParameter');
+ $param = $this->getMockBuilder('\OCP\DB\QueryBuilder\IParameter')->getMock();
$qb
->expects($this->once())
->method('createNamedParameter')
->method('where')
->with('myString')
->willReturn($qb);
- $stmt = $this->createMock('\Doctrine\DBAL\Driver\Statement');
+ $stmt = $this->getMockBuilder('\Doctrine\DBAL\Driver\Statement')->getMock();
$qb
->expects($this->once())
->method('execute')
->willReturn($stmt);
- $qb1 = $this->createMock('\OCP\DB\QueryBuilder\IQueryBuilder');
+ $qb1 = $this->getMockBuilder('\OCP\DB\QueryBuilder\IQueryBuilder')->getMock();
$qb1
->expects($this->once())
->method('insert')
}
public function testGetAdminSections() {
- $qb = $this->createMock('\OCP\DB\QueryBuilder\IQueryBuilder');
+ $qb = $this->getMockBuilder('\OCP\DB\QueryBuilder\IQueryBuilder')->getMock();
$qb
->expects($this->once())
->method('select')
->method('from')
->with('admin_sections')
->willReturn($qb);
- $stmt = $this->createMock('\Doctrine\DBAL\Driver\Statement');
+ $stmt = $this->getMockBuilder('\Doctrine\DBAL\Driver\Statement')->getMock();
$qb
->expects($this->once())
->method('execute')
}
public function testGetAdminSettings() {
- $qb = $this->createMock('\OCP\DB\QueryBuilder\IQueryBuilder');
+ $qb = $this->getMockBuilder('\OCP\DB\QueryBuilder\IQueryBuilder')->getMock();
$qb
->expects($this->once())
->method('select')
->method('from')
->with('admin_settings')
->willReturn($qb);
- $expressionBuilder = $this->createMock('\OCP\DB\QueryBuilder\IExpressionBuilder');
+ $expressionBuilder = $this->getMockBuilder('\OCP\DB\QueryBuilder\IExpressionBuilder')->getMock();
$qb
->expects($this->once())
->method('expr')
->willReturn($expressionBuilder);
- $param = $this->createMock('\OCP\DB\QueryBuilder\IParameter');
+ $param = $this->getMockBuilder('\OCP\DB\QueryBuilder\IParameter')->getMock();
$qb
->expects($this->once())
->method('createParameter')
->method('where')
->with('myString')
->willReturn($qb);
- $stmt = $this->createMock('\Doctrine\DBAL\Driver\Statement');
+ $stmt = $this->getMockBuilder('\Doctrine\DBAL\Driver\Statement')->getMock();
$qb
->expects($this->once())
->method('execute')