summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-11-27 15:27:18 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2019-11-27 15:27:18 +0100
commit3a7cf40aaa678bea1df143d2982d603b7a334eec (patch)
tree63c1e3ad7f7f401d14411a4d44c523632906afc9 /apps/files
parent0568b012672d650c6b5a49e72c4028dde5463c60 (diff)
downloadnextcloud-server-3a7cf40aaa678bea1df143d2982d603b7a334eec.tar.gz
nextcloud-server-3a7cf40aaa678bea1df143d2982d603b7a334eec.zip
Mode to modern phpunit
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/tests/Activity/Filter/GenericTest.php12
-rw-r--r--apps/files/tests/Activity/ProviderTest.php8
-rw-r--r--apps/files/tests/Activity/Setting/GenericTest.php14
-rw-r--r--apps/files/tests/BackgroundJob/ScanFilesTest.php2
-rw-r--r--apps/files/tests/Controller/ApiControllerTest.php2
-rw-r--r--apps/files/tests/Controller/ViewControllerTest.php2
6 files changed, 20 insertions, 20 deletions
diff --git a/apps/files/tests/Activity/Filter/GenericTest.php b/apps/files/tests/Activity/Filter/GenericTest.php
index f2b1acba3b3..8cae50c99c9 100644
--- a/apps/files/tests/Activity/Filter/GenericTest.php
+++ b/apps/files/tests/Activity/Filter/GenericTest.php
@@ -60,7 +60,7 @@ class GenericTest extends TestCase {
public function testGetIdentifier($filterClass) {
/** @var IFilter $filter */
$filter = \OC::$server->query($filterClass);
- $this->assertInternalType('string', $filter->getIdentifier());
+ $this->assertIsString($filter->getIdentifier());
}
/**
@@ -70,7 +70,7 @@ class GenericTest extends TestCase {
public function testGetName($filterClass) {
/** @var IFilter $filter */
$filter = \OC::$server->query($filterClass);
- $this->assertInternalType('string', $filter->getName());
+ $this->assertIsString($filter->getName());
}
/**
@@ -81,7 +81,7 @@ class GenericTest extends TestCase {
/** @var IFilter $filter */
$filter = \OC::$server->query($filterClass);
$priority = $filter->getPriority();
- $this->assertInternalType('int', $filter->getPriority());
+ $this->assertIsInt($filter->getPriority());
$this->assertGreaterThanOrEqual(0, $priority);
$this->assertLessThanOrEqual(100, $priority);
}
@@ -93,7 +93,7 @@ class GenericTest extends TestCase {
public function testGetIcon($filterClass) {
/** @var IFilter $filter */
$filter = \OC::$server->query($filterClass);
- $this->assertInternalType('string', $filter->getIcon());
+ $this->assertIsString($filter->getIcon());
$this->assertStringStartsWith('http', $filter->getIcon());
}
@@ -104,7 +104,7 @@ class GenericTest extends TestCase {
public function testFilterTypes($filterClass) {
/** @var IFilter $filter */
$filter = \OC::$server->query($filterClass);
- $this->assertInternalType('array', $filter->filterTypes([]));
+ $this->assertIsArray($filter->filterTypes([]));
}
/**
@@ -114,6 +114,6 @@ class GenericTest extends TestCase {
public function testAllowedApps($filterClass) {
/** @var IFilter $filter */
$filter = \OC::$server->query($filterClass);
- $this->assertInternalType('array', $filter->allowedApps());
+ $this->assertIsArray($filter->allowedApps());
}
}
diff --git a/apps/files/tests/Activity/ProviderTest.php b/apps/files/tests/Activity/ProviderTest.php
index da1f014ad05..cb8a2175307 100644
--- a/apps/files/tests/Activity/ProviderTest.php
+++ b/apps/files/tests/Activity/ProviderTest.php
@@ -55,7 +55,7 @@ class ProviderTest extends TestCase {
/** @var IEventMerger|\PHPUnit_Framework_MockObject_MockObject */
protected $eventMerger;
- public function setUp(): void {
+ protected function setUp(): void {
parent::setUp();
$this->l10nFactory = $this->createMock(IFactory::class);
@@ -136,10 +136,10 @@ class ProviderTest extends TestCase {
$this->assertSame('link-' . $id, $result['link']);
}
- /**
- * @expectedException \InvalidArgumentException
- */
+
public function testGetFileThrows() {
+ $this->expectException(\InvalidArgumentException::class);
+
$provider = $this->getProvider();
self::invokePrivate($provider, 'getFile', ['/Foo/Bar.txt', null]);
}
diff --git a/apps/files/tests/Activity/Setting/GenericTest.php b/apps/files/tests/Activity/Setting/GenericTest.php
index a8df291cb80..e93919ffd4d 100644
--- a/apps/files/tests/Activity/Setting/GenericTest.php
+++ b/apps/files/tests/Activity/Setting/GenericTest.php
@@ -61,7 +61,7 @@ class GenericTest extends TestCase {
public function testGetIdentifier($settingClass) {
/** @var ISetting $setting */
$setting = \OC::$server->query($settingClass);
- $this->assertInternalType('string', $setting->getIdentifier());
+ $this->assertIsString($setting->getIdentifier());
}
/**
@@ -71,7 +71,7 @@ class GenericTest extends TestCase {
public function testGetName($settingClass) {
/** @var ISetting $setting */
$setting = \OC::$server->query($settingClass);
- $this->assertInternalType('string', $setting->getName());
+ $this->assertIsString($setting->getName());
}
/**
@@ -82,7 +82,7 @@ class GenericTest extends TestCase {
/** @var ISetting $setting */
$setting = \OC::$server->query($settingClass);
$priority = $setting->getPriority();
- $this->assertInternalType('int', $setting->getPriority());
+ $this->assertIsInt($setting->getPriority());
$this->assertGreaterThanOrEqual(0, $priority);
$this->assertLessThanOrEqual(100, $priority);
}
@@ -94,7 +94,7 @@ class GenericTest extends TestCase {
public function testCanChangeStream($settingClass) {
/** @var ISetting $setting */
$setting = \OC::$server->query($settingClass);
- $this->assertInternalType('bool', $setting->canChangeStream());
+ $this->assertIsBool($setting->canChangeStream());
}
/**
@@ -104,7 +104,7 @@ class GenericTest extends TestCase {
public function testIsDefaultEnabledStream($settingClass) {
/** @var ISetting $setting */
$setting = \OC::$server->query($settingClass);
- $this->assertInternalType('bool', $setting->isDefaultEnabledStream());
+ $this->assertIsBool($setting->isDefaultEnabledStream());
}
/**
@@ -114,7 +114,7 @@ class GenericTest extends TestCase {
public function testCanChangeMail($settingClass) {
/** @var ISetting $setting */
$setting = \OC::$server->query($settingClass);
- $this->assertInternalType('bool', $setting->canChangeMail());
+ $this->assertIsBool($setting->canChangeMail());
}
/**
@@ -124,6 +124,6 @@ class GenericTest extends TestCase {
public function testIsDefaultEnabledMail($settingClass) {
/** @var ISetting $setting */
$setting = \OC::$server->query($settingClass);
- $this->assertInternalType('bool', $setting->isDefaultEnabledMail());
+ $this->assertIsBool($setting->isDefaultEnabledMail());
}
}
diff --git a/apps/files/tests/BackgroundJob/ScanFilesTest.php b/apps/files/tests/BackgroundJob/ScanFilesTest.php
index 8539c6ba7d3..f4110cfbad0 100644
--- a/apps/files/tests/BackgroundJob/ScanFilesTest.php
+++ b/apps/files/tests/BackgroundJob/ScanFilesTest.php
@@ -42,7 +42,7 @@ class ScanFilesTest extends TestCase {
/** @var ScanFiles */
private $scanFiles;
- public function setUp(): void {
+ protected function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
diff --git a/apps/files/tests/Controller/ApiControllerTest.php b/apps/files/tests/Controller/ApiControllerTest.php
index e5fbe7d3868..bd27fc2537d 100644
--- a/apps/files/tests/Controller/ApiControllerTest.php
+++ b/apps/files/tests/Controller/ApiControllerTest.php
@@ -68,7 +68,7 @@ class ApiControllerTest extends TestCase {
/** @var Folder|\PHPUnit_Framework_MockObject_MockObject */
private $userFolder;
- public function setUp(): void {
+ protected function setUp(): void {
parent::setUp();
$this->request = $this->getMockBuilder(IRequest::class)
diff --git a/apps/files/tests/Controller/ViewControllerTest.php b/apps/files/tests/Controller/ViewControllerTest.php
index c57be81b487..0e109128c5b 100644
--- a/apps/files/tests/Controller/ViewControllerTest.php
+++ b/apps/files/tests/Controller/ViewControllerTest.php
@@ -76,7 +76,7 @@ class ViewControllerTest extends TestCase {
/** @var Helper|\PHPUnit_Framework_MockObject_MockObject */
private $activityHelper;
- public function setUp(): void {
+ protected function setUp(): void {
parent::setUp();
$this->request = $this->getMockBuilder(IRequest::class)->getMock();
$this->urlGenerator = $this->getMockBuilder(IURLGenerator::class)->getMock();