aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-03-20 11:14:14 +0100
committerJoas Schilling <coding@schilljs.com>2017-03-20 11:14:14 +0100
commit5795482282bed45c678b26799da83e4da4ae2978 (patch)
treea5460e350375a47a2395779e2ccfd6135fb6e577
parent3eb831365770caa81434f5dbe1d659f1728fc121 (diff)
downloadnextcloud-server-5795482282bed45c678b26799da83e4da4ae2978.tar.gz
nextcloud-server-5795482282bed45c678b26799da83e4da4ae2978.zip
createMock
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--tests/lib/App/AppManagerTest.php32
1 files changed, 8 insertions, 24 deletions
diff --git a/tests/lib/App/AppManagerTest.php b/tests/lib/App/AppManagerTest.php
index 4ae53801ae3..bfb2893955f 100644
--- a/tests/lib/App/AppManagerTest.php
+++ b/tests/lib/App/AppManagerTest.php
@@ -35,9 +35,7 @@ class AppManagerTest extends TestCase {
*/
protected function getAppConfig() {
$appConfig = array();
- $config = $this->getMockBuilder(IAppConfig::class)
- ->disableOriginalConstructor()
- ->getMock();
+ $config = $this->createMock(IAppConfig::class);
$config->expects($this->any())
->method('getValue')
@@ -95,22 +93,12 @@ class AppManagerTest extends TestCase {
protected function setUp() {
parent::setUp();
- $this->userSession = $this->getMockBuilder(IUserSession::class)
- ->disableOriginalConstructor()
- ->getMock();
- $this->groupManager = $this->getMockBuilder(IGroupManager::class)
- ->disableOriginalConstructor()
- ->getMock();
+ $this->userSession = $this->createMock(IUserSession::class);
+ $this->groupManager = $this->createMock(IGroupManager::class);
$this->appConfig = $this->getAppConfig();
- $this->cacheFactory = $this->getMockBuilder(ICacheFactory::class)
- ->disableOriginalConstructor()
- ->getMock();
- $this->cache = $this->getMockBuilder(ICache::class)
- ->disableOriginalConstructor()
- ->getMock();
- $this->eventDispatcher = $this->getMockBuilder(EventDispatcherInterface::class)
- ->disableOriginalConstructor()
- ->getMock();
+ $this->cacheFactory = $this->createMock(ICacheFactory::class);
+ $this->cache = $this->createMock(ICache::class);
+ $this->eventDispatcher = $this->createMock(EventDispatcherInterface::class);
$this->cacheFactory->expects($this->any())
->method('create')
->with('settings')
@@ -267,12 +255,8 @@ class AppManagerTest extends TestCase {
}
private function newUser($uid) {
- $config = $this->getMockBuilder(IConfig::class)
- ->disableOriginalConstructor()
- ->getMock();
- $urlgenerator = $this->getMockBuilder(IURLGenerator::class)
- ->disableOriginalConstructor()
- ->getMock();
+ $config = $this->createMock(IConfig::class);
+ $urlgenerator = $this->createMock(IURLGenerator::class);
return new User($uid, null, null, $config, $urlgenerator);
}