Skip to content

Commit

Permalink
Declare testCase methods void to match modern phpunit declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-davis committed Jul 16, 2019
1 parent 7480e0d commit 6026ba0
Show file tree
Hide file tree
Showing 518 changed files with 666 additions and 666 deletions.
2 changes: 1 addition & 1 deletion apps/comments/tests/unit/ActivityListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class ActivityListenerTest extends \Test\TestCase {
*/
private $activityManager;

protected function setUp() {
protected function setUp(): void {
parent::setUp();

$this->activityManager = $this->createMock(IManager::class);
Expand Down
2 changes: 1 addition & 1 deletion apps/comments/tests/unit/Dav/CommentsNodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class CommentsNodeTest extends \Test\TestCase {
protected $logger;
protected $userSession;

public function setUp() {
public function setUp(): void {
parent::setUp();

$this->commentsManager = $this->createMock('\OCP\Comments\ICommentsManager');
Expand Down
2 changes: 1 addition & 1 deletion apps/comments/tests/unit/Dav/CommentsPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class CommentsPluginTest extends \Test\TestCase {
/** @var CommentsPluginImplementation */
private $plugin;

public function setUp() {
public function setUp(): void {
parent::setUp();
$this->tree = $this->getMockBuilder('\Sabre\DAV\Tree')
->disableOriginalConstructor()
Expand Down
2 changes: 1 addition & 1 deletion apps/comments/tests/unit/Dav/EntityCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class EntityCollectionTest extends \Test\TestCase {
/** @var EventDispatcherInterface | \PHPUnit\Framework\MockObject\MockObject */
private $dispatcher;

public function setUp() {
public function setUp(): void {
parent::setUp();

$this->commentsManager = $this->createMock(ICommentsManager::class);
Expand Down
2 changes: 1 addition & 1 deletion apps/comments/tests/unit/Dav/EntityTypeCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class EntityTypeCollectionTest extends \Test\TestCase {
/** @var EventDispatcherInterface | \PHPUnit\Framework\MockObject\MockObject */
private $dispatcher;

public function setUp() {
public function setUp(): void {
parent::setUp();

$this->commentsManager = $this->createMock(ICommentsManager::class);
Expand Down
2 changes: 1 addition & 1 deletion apps/comments/tests/unit/Dav/RootCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class RootCollectionTest extends \Test\TestCase {
/** @var \OCP\IUser|\PHPUnit\Framework\MockObject\MockObject */
protected $user;

public function setUp() {
public function setUp(): void {
parent::setUp();

$this->user = $this->createMock('\OCP\IUser');
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/tests/unit/Avatars/AvatarHomeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class AvatarHomeTest extends TestCase {
/** @var IAvatarManager | \PHPUnit\Framework\MockObject\MockObject */
private $avatarManager;

public function setUp() {
public function setUp(): void {
$this->avatarManager = $this->createMock(IAvatarManager::class);
$this->home = new AvatarHome(['uri' => 'principals/users/admin'], $this->avatarManager);
}
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/tests/unit/BackgroundJob/CleanPropertiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class CleanPropertiesTest extends TestCase {
/** @var string */
private $username;

public function setUp() {
public function setUp(): void {
parent::setUp();

$this->connection = \OC::$server->getDatabaseConnection();
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/tests/unit/CalDAV/AbstractCalDavBackendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ abstract class AbstractCalDavBackendTest extends TestCase {
/** @var ISecureRandom */
private $random;

public function setUp() {
public function setUp(): void {
parent::setUp();

$this->principal = $this->getMockBuilder(Principal::class)
Expand All @@ -83,7 +83,7 @@ public function setUp() {
$this->tearDown();
}

public function tearDown() {
public function tearDown(): void {
parent::tearDown();

if ($this->backend === null) {
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/tests/unit/CalDAV/CalendarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class CalendarTest extends TestCase {
/** @var IL10N */
private $l10n;

public function setUp() {
public function setUp(): void {
parent::setUp();
$this->l10n = $this->getMockBuilder(IL10N::class)
->disableOriginalConstructor()->getMock();
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/tests/unit/CalDAV/PluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class PluginTest extends TestCase {
/** @var Plugin */
private $plugin;

protected function setUp() {
protected function setUp(): void {
parent::setUp();

$this->plugin = new Plugin();
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class PublicCalendarRootTest extends TestCase {
/** @var ISecureRandom */
private $random;

public function setUp() {
public function setUp(): void {
parent::setUp();

$db = \OC::$server->getDatabaseConnection();
Expand All @@ -81,7 +81,7 @@ public function setUp() {
->disableOriginalConstructor()->getMock();
}

public function tearDown() {
public function tearDown(): void {
parent::tearDown();

if ($this->backend === null) {
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/tests/unit/CalDAV/Publishing/PublishingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class PluginTest extends TestCase {
/** @var IURLGenerator | \PHPUnit\Framework\MockObject\MockObject */
private $urlGenerator;

public function setUp() {
public function setUp(): void {
parent::setUp();

$this->config = $this->getMockBuilder('\OCP\IConfig')->
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/tests/unit/CardDAV/AddressBookImplTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class AddressBookImplTest extends TestCase {
/** @var VCard | \PHPUnit\Framework\MockObject\MockObject */
private $vCard;

public function setUp() {
public function setUp(): void {
parent::setUp();

$this->addressBookInfo = [
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class BirthdayServiceTest extends TestCase {
/** @var GroupPrincipalBackend | \PHPUnit\Framework\MockObject\MockObject */
private $groupPrincipalBackend;

public function setUp() {
public function setUp(): void {
parent::setUp();

$this->calDav = $this->getMockBuilder(CalDavBackend::class)->disableOriginalConstructor()->getMock();
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/tests/unit/CardDAV/CardDavBackendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class CardDavBackendTest extends TestCase {
const UNIT_TEST_USER1 = 'principals/users/carddav-unit-test1';
const UNIT_TEST_GROUP = 'principals/groups/carddav-unit-test-group';

public function setUp() {
public function setUp(): void {
parent::setUp();

$this->principal = $this->getMockBuilder(Principal::class)
Expand Down Expand Up @@ -98,7 +98,7 @@ public function setUp() {
$this->tearDown();
}

public function tearDown() {
public function tearDown(): void {
parent::tearDown();

if ($this->backend === null) {
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ImageExportPluginTest extends TestCase {
/** @var ILogger | \PHPUnit\Framework\MockObject\MockObject */
private $logger;

public function setUp() {
public function setUp(): void {
parent::setUp();

$this->request = $this->getMockBuilder('Sabre\HTTP\RequestInterface')->getMock();
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/tests/unit/CardDAV/Sharing/PluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class PluginTest extends TestCase {
/** @var IShareable | \PHPUnit\Framework\MockObject\MockObject */
private $book;

public function setUp() {
public function setUp(): void {
parent::setUp();

/** @var Auth | \PHPUnit\Framework\MockObject\MockObject $authBackend */
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/tests/unit/Command/CleanupChunksTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class CleanupChunksTest extends TestCase {
/** @var IUser */
private $user;

public function setUp() {
public function setUp(): void {
parent::setUp();

$command = new CleanupChunks(\OC::$server->getUserManager());
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/tests/unit/Connector/PublicAuthTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class PublicAuthTest extends \Test\TestCase {
/** @var string */
private $oldUser;

protected function setUp() {
protected function setUp(): void {
parent::setUp();

$this->session = $this->createMock('\OCP\ISession');
Expand All @@ -66,7 +66,7 @@ protected function setUp() {
$this->oldUser = \OC_User::getUser();
}

protected function tearDown() {
protected function tearDown(): void {
\OC_User::setIncognitoMode(false);

// Set old user
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/tests/unit/Connector/Sabre/AuthTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class AuthTest extends TestCase {
/** @var AccountModuleManager | \PHPUnit\Framework\MockObject\MockObject */
private $accountModuleManager;

public function setUp() {
public function setUp(): void {
parent::setUp();
$this->session = $this->createMock(ISession::class);
$this->userSession = $this->createMock(Session::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class BlockLegacyClientPluginTest extends TestCase {
/** @var BlockLegacyClientPlugin */
private $blockLegacyClientVersionPlugin;

public function setUp() {
public function setUp(): void {
parent::setUp();

$this->config = $this->createMock('\OCP\IConfig');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class CommentsPropertiesPluginTest extends \Test\TestCase {
protected $server;
protected $userFolder;

public function setUp() {
public function setUp(): void {
parent::setUp();

$this->commentsManager = $this->createMock('\OCP\Comments\ICommentsManager');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class CopyEtagHeaderPluginTest extends TestCase {
/** @var Server */
private $server;

public function setUp() {
public function setUp(): void {
parent::setUp();
$this->server = new \Sabre\DAV\Server();
$this->plugin = new CopyEtagHeaderPlugin();
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/tests/unit/Connector/Sabre/CorsPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class CorsPluginTest extends TestCase {
*/
private $config;

public function setUp() {
public function setUp(): void {
parent::setUp();
$this->server = new Server();

Expand Down Expand Up @@ -80,7 +80,7 @@ public function setUp() {
$this->server->addPlugin($extraMethodPlugin);
}

public function tearDown() {
public function tearDown(): void {
$this->restoreService('AllConfig');
}

Expand Down
2 changes: 1 addition & 1 deletion apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class DirectoryTest extends \Test\TestCase {
/** @var \OC\Files\FileInfo | \PHPUnit\Framework\MockObject\MockObject */
private $info;

protected function setUp() {
protected function setUp(): void {
parent::setUp();

$this->view = $this->createMock('OC\Files\View', [], [], '', false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class DummyGetResponsePluginTest extends TestCase {
/** @var DummyGetResponsePlugin */
private $dummyGetResponsePlugin;

public function setUp() {
public function setUp(): void {
parent::setUp();

$this->dummyGetResponsePlugin = new DummyGetResponsePlugin();
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/tests/unit/Connector/Sabre/FileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class FileTest extends TestCase {
/** @var IConfig | \PHPUnit\Framework\MockObject\MockObject */
protected $config;

public function setUp() {
public function setUp(): void {
parent::setUp();
unset($_SERVER['HTTP_OC_CHUNKED'], $_SERVER['CONTENT_LENGTH'], $_SERVER['REQUEST_METHOD']);

Expand All @@ -84,7 +84,7 @@ public function setUp() {
$this->config = $this->getMockBuilder('\OCP\IConfig')->getMock();
}

public function tearDown() {
public function tearDown(): void {
$userManager = \OC::$server->getUserManager();
if ($userManager->userExists($this->user)) {
$userManager->get($this->user)->delete();
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class FilesPluginTest extends TestCase {
*/
private $request;

public function setUp() {
public function setUp(): void {
parent::setUp();
$this->server = $this->getMockBuilder(Server::class)
->disableOriginalConstructor()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class FilesReportPluginTest extends \Test\TestCase {
/** @var Folder|\PHPUnit\Framework\MockObject\MockObject **/
private $userFolder;

public function setUp() {
public function setUp(): void {
parent::setUp();
$this->tree = $this->getMockBuilder('\Sabre\DAV\Tree')
->disableOriginalConstructor()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class FilesSearchReportPluginTest extends \Test\TestCase {
/** @var FilesSearchReportPlugin|\PHPUnit\Framework\MockObject\MockObject */
private $plugin;

public function setUp() {
public function setUp(): void {
parent::setUp();

$this->tree = $this->getMockBuilder(Tree::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class MaintenancePluginTest extends TestCase {
/** @var MaintenancePlugin */
private $maintenancePlugin;

public function setUp() {
public function setUp(): void {
parent::setUp();

$this->config = $this->createMock('\OCP\IConfig');
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class PrincipalTest extends TestCase {
/** @var IGroupManager | \PHPUnit\Framework\MockObject\MockObject */
private $groupManager;

public function setUp() {
public function setUp(): void {
$this->userManager = $this->getMockBuilder('\OCP\IUserManager')
->disableOriginalConstructor()->getMock();
$this->groupManager = $this->getMockBuilder('\OCP\IGroupManager')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@
class PartFileInRootUploadTest extends UploadTest {
protected $original;

protected function setUp() {
protected function setUp(): void {
$config = \OC::$server->getConfig();
$this->original = $config->getSystemValue('part_file_in_storage', null);
$config->setSystemValue('part_file_in_storage', false);
parent::setUp();
}

protected function tearDown() {
protected function tearDown(): void {
if ($this->original !== null) {
$config = \OC::$server->getConfig();
$this->original = $config->setSystemValue('part_file_in_storage', $this->original);
}
return parent::tearDown();
parent::tearDown();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected function getStream($string) {
return $stream;
}

protected function setUp() {
protected function setUp(): void {
parent::setUp();

unset($_SERVER['HTTP_OC_CHUNKED']);
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class SharesPluginTest extends \Test\TestCase {
*/
private $plugin;

public function setUp() {
public function setUp(): void {
parent::setUp();
$this->server = new \Sabre\DAV\Server();
$this->tree = $this->getMockBuilder('\Sabre\DAV\Tree')
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class TagsPluginTest extends \Test\TestCase {
*/
private $plugin;

public function setUp() {
public function setUp(): void {
parent::setUp();
$this->server = new \Sabre\DAV\Server();
$this->tree = $this->getMockBuilder('\Sabre\DAV\Tree')
Expand Down
Loading

0 comments on commit 6026ba0

Please sign in to comment.