summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-08-25 22:37:14 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2016-08-25 22:41:23 +0200
commitc5bdb4d4e842740262fdf48958ba30d5eb1fc062 (patch)
tree1375287ba7171e43436c1f93cf2b13708532bb17 /tests
parent680d7f22bbdcc41a89a333d19ec3f55bc75dd525 (diff)
downloadnextcloud-server-c5bdb4d4e842740262fdf48958ba30d5eb1fc062.tar.gz
nextcloud-server-c5bdb4d4e842740262fdf48958ba30d5eb1fc062.zip
L10N tests do not require DB
* Makes CI a bit more efficient * Cleanup getMock warning
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/L10N/FactoryTest.php17
-rw-r--r--tests/lib/L10N/L10nLegacyTest.php7
2 files changed, 16 insertions, 8 deletions
diff --git a/tests/lib/L10N/FactoryTest.php b/tests/lib/L10N/FactoryTest.php
index 98bb5ec13c9..bb72d84941c 100644
--- a/tests/lib/L10N/FactoryTest.php
+++ b/tests/lib/L10N/FactoryTest.php
@@ -15,7 +15,6 @@ use Test\TestCase;
* Class FactoryTest
*
* @package Test\L10N
- * @group DB
*/
class FactoryTest extends TestCase {
@@ -44,7 +43,9 @@ class FactoryTest extends TestCase {
->disableOriginalConstructor()
->getMock();
- $this->userSession = $this->getMock('\OCP\IUserSession');
+ $this->userSession = $this->getMockBuilder('\OCP\IUserSession')
+ ->disableOriginalConstructor()
+ ->getMock();
$this->serverRoot = \OC::$SERVERROOT;
}
@@ -110,7 +111,8 @@ class FactoryTest extends TestCase {
->method('getSystemValue')
->with('installed', false)
->willReturn(true);
- $user = $this->getMock('\OCP\IUser');
+ $user = $this->getMockBuilder('\OCP\IUser')
+ ->getMock();
$user->expects($this->once())
->method('getUID')
->willReturn('MyUserUid');
@@ -143,7 +145,8 @@ class FactoryTest extends TestCase {
->method('getSystemValue')
->with('installed', false)
->willReturn(true);
- $user = $this->getMock('\OCP\IUser');
+ $user = $this->getMockBuilder('\OCP\IUser')
+ ->getMock();
$user->expects($this->once())
->method('getUID')
->willReturn('MyUserUid');
@@ -185,7 +188,8 @@ class FactoryTest extends TestCase {
->method('getSystemValue')
->with('installed', false)
->willReturn(true);
- $user = $this->getMock('\OCP\IUser');
+ $user = $this->getMockBuilder('\OCP\IUser')
+ ->getMock();
$user->expects($this->once())
->method('getUID')
->willReturn('MyUserUid');
@@ -230,7 +234,8 @@ class FactoryTest extends TestCase {
->method('getSystemValue')
->with('installed', false)
->willReturn(true);
- $user = $this->getMock('\OCP\IUser');
+ $user = $this->getMockBuilder('\OCP\IUser')
+ ->getMock();
$user->expects($this->once())
->method('getUID')
->willReturn('MyUserUid');
diff --git a/tests/lib/L10N/L10nLegacyTest.php b/tests/lib/L10N/L10nLegacyTest.php
index 1df22ba36bd..71b4e21f1a1 100644
--- a/tests/lib/L10N/L10nLegacyTest.php
+++ b/tests/lib/L10N/L10nLegacyTest.php
@@ -14,7 +14,6 @@ use DateTime;
/**
* Class Test_L10n
- * @group DB
*/
class L10nLegacyTest extends \Test\TestCase {
@@ -124,7 +123,11 @@ class L10nLegacyTest extends \Test\TestCase {
}
public function testFactoryGetLanguageCode() {
- $factory = new \OC\L10N\Factory($this->getMock('OCP\IConfig'), $this->getMock('OCP\IRequest'), $this->getMock('OCP\IUserSession'), \OC::$SERVERROOT);
+ $factory = new \OC\L10N\Factory(
+ $this->getMockBuilder('OCP\IConfig')->getMock(),
+ $this->getMockBuilder('OCP\IRequest')->getMock(),
+ $this->getMockBuilder('OCP\IUserSession')->getMock(),
+ \OC::$SERVERROOT);
$l = $factory->get('lib', 'de');
$this->assertEquals('de', $l->getLanguageCode());
}