diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2018-01-25 14:50:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-25 14:50:46 +0100 |
commit | 8160d0bc2aa334806e6c6e45e4f49bd9cf1a8097 (patch) | |
tree | 38a85a16e46ab97f9f8ab4afc3afbd596ce7fb24 /apps | |
parent | fe88e7f9264e3826e7efeb7144eb8ce0267cefe8 (diff) | |
parent | 4718d2b80d88170f3814d3f7795bda9557ef12ac (diff) | |
download | nextcloud-server-8160d0bc2aa334806e6c6e45e4f49bd9cf1a8097.tar.gz nextcloud-server-8160d0bc2aa334806e6c6e45e4f49bd9cf1a8097.zip |
Merge pull request #8036 from nextcloud/phpunit6
Require PHPUnit 6.5 or higher
Diffstat (limited to 'apps')
29 files changed, 67 insertions, 60 deletions
diff --git a/apps/dav/tests/unit/AppInfo/ApplicationTest.php b/apps/dav/tests/unit/AppInfo/ApplicationTest.php index bb6cfe67b4d..d4f53d360a9 100644 --- a/apps/dav/tests/unit/AppInfo/ApplicationTest.php +++ b/apps/dav/tests/unit/AppInfo/ApplicationTest.php @@ -61,6 +61,6 @@ class ApplicationTest extends TestCase { /** @var IManager|\PHPUnit_Framework_MockObject_MockObject $cm */ $cm = $this->createMock(IManager::class); $app->setupContactsProvider($cm, 'xxx'); - $this->assertTrue(true); + $this->addToAssertionCount(1); } } diff --git a/apps/dav/tests/unit/AppInfo/PluginManagerTest.php b/apps/dav/tests/unit/AppInfo/PluginManagerTest.php index 89c972acd26..a4fcef92511 100644 --- a/apps/dav/tests/unit/AppInfo/PluginManagerTest.php +++ b/apps/dav/tests/unit/AppInfo/PluginManagerTest.php @@ -22,8 +22,8 @@ namespace OCA\DAV\Tests\unit\AppInfo; +use OC\App\AppManager; use Test\TestCase; -use OCP\App\IAppManager; use OC\ServerContainer; use OCA\DAV\AppInfo\PluginManager; @@ -37,7 +37,7 @@ class PluginManagerTest extends TestCase { $server = $this->createMock(ServerContainer::class); - $appManager = $this->createMock(IAppManager::class); + $appManager = $this->createMock(AppManager::class); $appManager->method('getInstalledApps') ->willReturn(['adavapp', 'adavapp2']); diff --git a/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php b/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php index 2a01bd425c0..310433f0913 100644 --- a/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php +++ b/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php @@ -176,7 +176,7 @@ EOD; protected function assertAcl($principal, $privilege, $acl) { foreach($acl as $a) { if ($a['principal'] === $principal && $a['privilege'] === $privilege) { - $this->assertTrue(true); + $this->addToAssertionCount(1); return; } } @@ -190,7 +190,7 @@ EOD; return; } } - $this->assertTrue(true); + $this->addToAssertionCount(1); } protected function assertAccess($shouldHaveAcl, $principal, $privilege, $acl) { diff --git a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php index 0b8978a0409..fd048240467 100644 --- a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php +++ b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php @@ -36,6 +36,7 @@ use OCP\IL10N; use Sabre\DAV\PropPatch; use Sabre\DAV\Xml\Property\Href; use Sabre\DAVACL\IACL; +use Sabre\DAV\Exception\NotFound; /** * Class CalDavBackendTest @@ -526,7 +527,7 @@ EOD; $calendar->setPublishStatus(false); $this->assertEquals(false, $calendar->getPublishStatus()); - $this->setExpectedException('Sabre\DAV\Exception\NotFound'); + $this->expectException(NotFound::class); $this->backend->getPublicCalendar($publicCalendarURI); } diff --git a/apps/dav/tests/unit/CalDAV/CalendarTest.php b/apps/dav/tests/unit/CalDAV/CalendarTest.php index dbdbf0dbafd..f467d46bf60 100644 --- a/apps/dav/tests/unit/CalDAV/CalendarTest.php +++ b/apps/dav/tests/unit/CalDAV/CalendarTest.php @@ -183,7 +183,7 @@ class CalendarTest extends TestCase { ->with(666, $propPatch); } $c->propPatch($propPatch); - $this->assertTrue(true); + $this->addToAssertionCount(1); } /** diff --git a/apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php b/apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php index b2ba8ba119a..36aa4fa449b 100644 --- a/apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php +++ b/apps/dav/tests/unit/CalDAV/Publishing/PublisherTest.php @@ -25,8 +25,9 @@ namespace OCA\DAV\Tests\unit\CalDAV\Publishing; use OCA\DAV\CalDAV\Publishing\Xml\Publisher; use Sabre\Xml\Writer; +use Test\TestCase; -class PublisherTest extends \PHPUnit_Framework_TestCase { +class PublisherTest extends TestCase { const NS_CALENDARSERVER = 'http://calendarserver.org/ns/'; diff --git a/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php b/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php index cbde8c2ef68..91973eeff5d 100644 --- a/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php @@ -174,7 +174,7 @@ class CustomPropertiesBackendTest extends \Test\TestCase { ); // no exception, soft fail - $this->assertTrue(true); + $this->addToAssertionCount(1); } /** diff --git a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php index e72987ef02d..968cb548068 100644 --- a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php @@ -345,7 +345,7 @@ class DirectoryTest extends \Test\TestCase { */ public function testMoveSuccess($source, $destination, $updatables, $deletables) { $this->moveTest($source, $destination, $updatables, $deletables); - $this->assertTrue(true); + $this->addToAssertionCount(1); } /** diff --git a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php index 800bdfd3598..ea520bca7e5 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php @@ -29,6 +29,7 @@ namespace OCA\DAV\Tests\unit\Connector\Sabre; use OC\User\User; +use OCA\DAV\Connector\Sabre\Directory; use OCA\DAV\Connector\Sabre\File; use OCA\DAV\Connector\Sabre\FilesPlugin; use OCA\DAV\Connector\Sabre\Node; @@ -319,7 +320,7 @@ class FilesPluginTest extends TestCase { } public function testGetPropertiesForRootDirectory() { - /** @var \OCA\DAV\Connector\Sabre\Directory | \PHPUnit_Framework_MockObject_MockObject $node */ + /** @var \OCA\DAV\Connector\Sabre\Directory|\PHPUnit_Framework_MockObject_MockObject $node */ $node = $this->getMockBuilder(Directory::class) ->disableOriginalConstructor() ->getMock(); @@ -382,6 +383,8 @@ class FilesPluginTest extends TestCase { $propFind, $node ); + + $this->addToAssertionCount(1); } public function testUpdateProps() { diff --git a/apps/dav/tests/unit/SystemTag/SystemTagNodeTest.php b/apps/dav/tests/unit/SystemTag/SystemTagNodeTest.php index 18c774883c0..b9a6efdcc22 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagNodeTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagNodeTest.php @@ -251,7 +251,7 @@ class SystemTagNodeTest extends \Test\TestCase { ->method('deleteTags') ->with('1'); if (!$isAdmin) { - $this->setExpectedException(Forbidden::class); + $this->expectException(Forbidden::class); } $this->getTagNode($isAdmin, $tag)->delete(); } @@ -282,7 +282,7 @@ class SystemTagNodeTest extends \Test\TestCase { $this->tagManager->expects($this->never()) ->method('deleteTags'); - $this->setExpectedException($expectedException); + $this->expectException($expectedException); $this->getTagNode(false, $tag)->delete(); } diff --git a/apps/dav/tests/unit/bootstrap.php b/apps/dav/tests/unit/bootstrap.php index 178bc695b6a..a2ad505342b 100644 --- a/apps/dav/tests/unit/bootstrap.php +++ b/apps/dav/tests/unit/bootstrap.php @@ -26,10 +26,6 @@ if (!defined('PHPUNIT_RUN')) { require_once __DIR__.'/../../../../lib/base.php'; -if(!class_exists('PHPUnit_Framework_TestCase')) { - require_once('PHPUnit/Autoload.php'); -} - \OC::$composerAutoloader->addPsr4('Test\\', OC::$SERVERROOT . '/tests/lib/', true); \OC_App::loadApp('dav'); diff --git a/apps/encryption/tests/Crypto/EncryptAllTest.php b/apps/encryption/tests/Crypto/EncryptAllTest.php index 0d894ab6fd7..a39bf7befb6 100644 --- a/apps/encryption/tests/Crypto/EncryptAllTest.php +++ b/apps/encryption/tests/Crypto/EncryptAllTest.php @@ -335,8 +335,10 @@ class EncryptAllTest extends TestCase { $encryptAll->expects($this->at(1))->method('encryptFile')->with('/user1/files/bar'); $encryptAll->expects($this->at(2))->method('encryptFile')->with('/user1/files/foo/subfile'); - $progressBar = $this->getMockBuilder(ProgressBar::class) - ->disableOriginalConstructor()->getMock(); + $this->outputInterface->expects($this->any()) + ->method('getFormatter') + ->willReturn($this->createMock(OutputFormatterInterface::class)); + $progressBar = new ProgressBar($this->outputInterface); $this->invokePrivate($encryptAll, 'encryptUsersFiles', ['user1', $progressBar, '']); diff --git a/apps/encryption/tests/Hooks/UserHooksTest.php b/apps/encryption/tests/Hooks/UserHooksTest.php index f951ddb37f7..91005e2746a 100644 --- a/apps/encryption/tests/Hooks/UserHooksTest.php +++ b/apps/encryption/tests/Hooks/UserHooksTest.php @@ -110,7 +110,7 @@ class UserHooksTest extends TestCase { $this->sessionMock->expects($this->once()) ->method('clear'); $this->instance->logout(); - $this->assertTrue(true); + $this->addToAssertionCount(1); } public function testPostCreateUser() { @@ -118,7 +118,7 @@ class UserHooksTest extends TestCase { ->method('setupUser'); $this->instance->postCreateUser($this->params); - $this->assertTrue(true); + $this->addToAssertionCount(1); } public function testPostDeleteUser() { @@ -127,7 +127,7 @@ class UserHooksTest extends TestCase { ->with('testUser'); $this->instance->postDeleteUser($this->params); - $this->assertTrue(true); + $this->addToAssertionCount(1); } public function testPrePasswordReset() { diff --git a/apps/encryption/tests/RecoveryTest.php b/apps/encryption/tests/RecoveryTest.php index b83b71737f3..0eb9a777ec3 100644 --- a/apps/encryption/tests/RecoveryTest.php +++ b/apps/encryption/tests/RecoveryTest.php @@ -213,7 +213,7 @@ class RecoveryTest extends TestCase { $this->cryptMock->expects($this->once()) ->method('decryptPrivateKey'); $this->instance->recoverUsersFiles('password', 'admin'); - $this->assertTrue(true); + $this->addToAssertionCount(1); } public function testRecoverFile() { diff --git a/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php b/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php index 013af9b0426..452d8589a3d 100644 --- a/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php +++ b/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php @@ -304,66 +304,66 @@ class UserGlobalStoragesServiceTest extends GlobalStoragesServiceTest { public function testGetStoragesBackendNotVisible() { // we don't test this here - $this->assertTrue(true); + $this->addToAssertionCount(1); } public function testGetStoragesAuthMechanismNotVisible() { // we don't test this here - $this->assertTrue(true); + $this->addToAssertionCount(1); } public function testHooksAddStorage($a = null, $b = null, $c = null) { // we don't test this here - $this->assertTrue(true); + $this->addToAssertionCount(1); } public function testHooksUpdateStorage($a = null, $b = null, $c = null, $d = null, $e = null) { // we don't test this here - $this->assertTrue(true); + $this->addToAssertionCount(1); } public function testHooksRenameMountPoint() { // we don't test this here - $this->assertTrue(true); + $this->addToAssertionCount(1); } public function testHooksDeleteStorage($a = null, $b = null, $c = null) { // we don't test this here - $this->assertTrue(true); + $this->addToAssertionCount(1); } public function testLegacyConfigConversionApplicableAll() { // we don't test this here - $this->assertTrue(true); + $this->addToAssertionCount(1); } public function testLegacyConfigConversionApplicableUserAndGroup() { // we don't test this here - $this->assertTrue(true); + $this->addToAssertionCount(1); } public function testReadLegacyConfigAndGenerateConfigId() { // we don't test this here - $this->assertTrue(true); + $this->addToAssertionCount(1); } public function testReadLegacyConfigNoAuthMechanism() { // we don't test this here - $this->assertTrue(true); + $this->addToAssertionCount(1); } public function testReadLegacyConfigClass() { // we don't test this here - $this->assertTrue(true); + $this->addToAssertionCount(1); } public function testReadEmptyMountPoint() { // we don't test this here - $this->assertTrue(true); + $this->addToAssertionCount(1); } public function testUpdateStorageMountPoint() { // we don't test this here - $this->assertTrue(true); + $this->addToAssertionCount(1); } } diff --git a/apps/files_sharing/tests/ApiTest.php b/apps/files_sharing/tests/ApiTest.php index 8e2b5942d14..6d8e2dd8d84 100644 --- a/apps/files_sharing/tests/ApiTest.php +++ b/apps/files_sharing/tests/ApiTest.php @@ -236,7 +236,7 @@ class ApiTest extends TestCase { $ocs->cleanup(); } - function testEnfoceLinkPassword() { + function testEnforceLinkPassword() { $password = md5(time()); $config = \OC::$server->getConfig(); @@ -288,6 +288,7 @@ class ApiTest extends TestCase { $ocs->cleanup(); $config->setAppValue('core', 'shareapi_enforce_links_password', 'no'); + $this->addToAssertionCount(1); } /** @@ -336,6 +337,8 @@ class ApiTest extends TestCase { // cleanup \OC::$server->getConfig()->setAppValue('core', 'shareapi_exclude_groups', 'no'); \OC::$server->getConfig()->setAppValue('core', 'shareapi_exclude_groups_list', ''); + + $this->addToAssertionCount(1); } @@ -1102,6 +1105,7 @@ class ApiTest extends TestCase { $ocs->cleanup(); $this->shareManager->deleteShare($share1); + $this->addToAssertionCount(1); } /** diff --git a/apps/files_sharing/tests/External/ScannerTest.php b/apps/files_sharing/tests/External/ScannerTest.php index 1ad19d5c80f..fe77182e83f 100644 --- a/apps/files_sharing/tests/External/ScannerTest.php +++ b/apps/files_sharing/tests/External/ScannerTest.php @@ -58,7 +58,7 @@ class ScannerTest extends TestCase { // Declaration of OCA\Files_Sharing\External\Scanner::*() should be // compatible with OC\Files\Cache\Scanner::*() $this->scanner->scanAll(); - $this->assertTrue(true); + $this->addToAssertionCount(1); } public function testScan() { @@ -70,7 +70,7 @@ class ScannerTest extends TestCase { // Declaration of OCA\Files_Sharing\External\Scanner::*() should be // compatible with OC\Files\Cache\Scanner::*() $this->scanner->scan('test', Scanner::SCAN_RECURSIVE); - $this->assertTrue(true); + $this->addToAssertionCount(1); } public function testScanFile() { @@ -78,6 +78,6 @@ class ScannerTest extends TestCase { // Declaration of OCA\Files_Sharing\External\Scanner::*() should be // compatible with OC\Files\Cache\Scanner::*() $this->scanner->scanFile('test', Scanner::SCAN_RECURSIVE); - $this->assertTrue(true); + $this->addToAssertionCount(1); } } diff --git a/apps/files_sharing/tests/LockingTest.php b/apps/files_sharing/tests/LockingTest.php index 4af5e3e2cee..414e8790819 100644 --- a/apps/files_sharing/tests/LockingTest.php +++ b/apps/files_sharing/tests/LockingTest.php @@ -111,6 +111,6 @@ class LockingTest extends TestCase { $recipientView->changeLock('bar.txt', ILockingProvider::LOCK_EXCLUSIVE); $recipientView->unlockFile('bar.txt', ILockingProvider::LOCK_EXCLUSIVE); - $this->assertTrue(true); + $this->addToAssertionCount(1); } } diff --git a/apps/files_sharing/tests/Middleware/OCSShareAPIMiddlewareTest.php b/apps/files_sharing/tests/Middleware/OCSShareAPIMiddlewareTest.php index c260a65725d..8cbf03b8b61 100644 --- a/apps/files_sharing/tests/Middleware/OCSShareAPIMiddlewareTest.php +++ b/apps/files_sharing/tests/Middleware/OCSShareAPIMiddlewareTest.php @@ -136,5 +136,6 @@ class OCSShareAPIMiddlewareTest extends \Test\TestCase { ->disableOriginalConstructor() ->getMock(); $this->middleware->afterController($controller, 'foo', $response); + $this->addToAssertionCount(1); } } diff --git a/apps/files_trashbin/tests/BackgroundJob/ExpireTrashTest.php b/apps/files_trashbin/tests/BackgroundJob/ExpireTrashTest.php index 882099efc99..5339d600722 100644 --- a/apps/files_trashbin/tests/BackgroundJob/ExpireTrashTest.php +++ b/apps/files_trashbin/tests/BackgroundJob/ExpireTrashTest.php @@ -39,6 +39,6 @@ class ExpireTrashTest extends \Test\TestCase { /** @var \OC\BackgroundJob\JobList $jobList */ $backgroundJob->execute($jobList); - $this->assertTrue(true); + $this->addToAssertionCount(1); } } diff --git a/apps/files_trashbin/tests/Command/ExpireTest.php b/apps/files_trashbin/tests/Command/ExpireTest.php index bdc8d867944..2076326cf13 100644 --- a/apps/files_trashbin/tests/Command/ExpireTest.php +++ b/apps/files_trashbin/tests/Command/ExpireTest.php @@ -39,6 +39,6 @@ class ExpireTest extends TestCase { $command = new Expire('test'); $command->handle(); - $this->assertTrue(true); + $this->addToAssertionCount(1); } } diff --git a/apps/files_trashbin/tests/StorageTest.php b/apps/files_trashbin/tests/StorageTest.php index 0e23ea6a3ba..67e622aa1c9 100644 --- a/apps/files_trashbin/tests/StorageTest.php +++ b/apps/files_trashbin/tests/StorageTest.php @@ -593,6 +593,7 @@ class StorageTest extends \Test\TestCase { $this->markTestSkipped('Skipping since the current home storage backend requires the user to logged in'); } else { $this->userView->unlink('test.txt'); + $this->addToAssertionCount(1); } } } diff --git a/apps/files_versions/tests/Command/ExpireTest.php b/apps/files_versions/tests/Command/ExpireTest.php index 3815bc5b75e..c56624d0264 100644 --- a/apps/files_versions/tests/Command/ExpireTest.php +++ b/apps/files_versions/tests/Command/ExpireTest.php @@ -39,6 +39,6 @@ class ExpireTest extends TestCase { $command = new Expire($this->getUniqueID('test'), ''); $command->handle(); - $this->assertTrue(true); + $this->addToAssertionCount(1); } } diff --git a/apps/provisioning_api/tests/Controller/AppConfigControllerTest.php b/apps/provisioning_api/tests/Controller/AppConfigControllerTest.php index 7f24ef5bcb3..223f2c371d6 100644 --- a/apps/provisioning_api/tests/Controller/AppConfigControllerTest.php +++ b/apps/provisioning_api/tests/Controller/AppConfigControllerTest.php @@ -318,7 +318,7 @@ class AppConfigControllerTest extends TestCase { public function testVerifyAppId() { $api = $this->getInstance(); $this->invokePrivate($api, 'verifyAppId', ['activity']); - $this->assertTrue(true); + $this->addToAssertionCount(1); } public function dataVerifyAppIdThrows() { @@ -356,7 +356,7 @@ class AppConfigControllerTest extends TestCase { public function testVerifyConfigKey($app, $key) { $api = $this->getInstance(); $this->invokePrivate($api, 'verifyConfigKey', [$app, $key]); - $this->assertTrue(true); + $this->addToAssertionCount(1); } public function dataVerifyConfigKeyThrows() { diff --git a/apps/theming/tests/IconBuilderTest.php b/apps/theming/tests/IconBuilderTest.php index 4f5078d4c56..a2a330a2f24 100644 --- a/apps/theming/tests/IconBuilderTest.php +++ b/apps/theming/tests/IconBuilderTest.php @@ -34,6 +34,7 @@ use OCP\Files\IAppData; use OCP\Files\IRootFolder; use OCP\Files\NotFoundException; use OCP\IConfig; +use PHPUnit\Framework\Error\Warning; use Test\TestCase; class IconBuilderTest extends TestCase { @@ -172,11 +173,9 @@ class IconBuilderTest extends TestCase { // cloud be something like $expectedIcon->compareImages($icon, Imagick::METRIC_MEANABSOLUTEERROR)[1]) } - /** - * @expectedException \PHPUnit_Framework_Error_Warning - */ public function testGetFaviconNotFound() { $this->checkImagick(); + $this->expectException(Warning::class); $util = $this->getMockBuilder(Util::class)->disableOriginalConstructor()->getMock(); $iconBuilder = new IconBuilder($this->themingDefaults, $util); $this->themingDefaults->expects($this->once()) @@ -188,11 +187,9 @@ class IconBuilderTest extends TestCase { $this->assertFalse($iconBuilder->getFavicon('noapp')); } - /** - * @expectedException \PHPUnit_Framework_Error_Warning - */ public function testGetTouchIconNotFound() { $this->checkImagick(); + $this->expectException(Warning::class); $util = $this->getMockBuilder(Util::class)->disableOriginalConstructor()->getMock(); $iconBuilder = new IconBuilder($this->themingDefaults, $util); $util->expects($this->once()) @@ -201,11 +198,9 @@ class IconBuilderTest extends TestCase { $this->assertFalse($iconBuilder->getTouchIcon('noapp')); } - /** - * @expectedException \PHPUnit_Framework_Error_Warning - */ public function testColorSvgNotFound() { $this->checkImagick(); + $this->expectException(Warning::class); $util = $this->getMockBuilder(Util::class)->disableOriginalConstructor()->getMock(); $iconBuilder = new IconBuilder($this->themingDefaults, $util); $util->expects($this->once()) diff --git a/apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php b/apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php index a56098556e5..17d332691d2 100644 --- a/apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php +++ b/apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php @@ -62,7 +62,7 @@ class ProviderTest extends TestCase { $event->expects($this->once()) ->method('getApp') ->willReturn('comments'); - $this->setExpectedException(InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $this->provider->parse($lang, $event); } diff --git a/apps/user_ldap/tests/LDAPProviderTest.php b/apps/user_ldap/tests/LDAPProviderTest.php index f3a27dec2c4..8df527e0dd8 100644 --- a/apps/user_ldap/tests/LDAPProviderTest.php +++ b/apps/user_ldap/tests/LDAPProviderTest.php @@ -429,7 +429,7 @@ class LDAPProviderTest extends \Test\TestCase { $ldapProvider = $this->getLDAPProvider($server); $ldapProvider->clearCache('existing_user'); - $this->assertTrue(TRUE); + $this->addToAssertionCount(1); } /** @@ -474,7 +474,7 @@ class LDAPProviderTest extends \Test\TestCase { $ldapProvider = $this->getLDAPProvider($server); $ldapProvider->clearGroupCache('existing_group'); - $this->assertTrue(TRUE); + $this->addToAssertionCount(1); } public function testDnExists() { @@ -502,7 +502,7 @@ class LDAPProviderTest extends \Test\TestCase { $ldapProvider = $this->getLDAPProvider($server); $ldapProvider->flagRecord('existing_user'); - $this->assertTrue(TRUE); + $this->addToAssertionCount(1); } public function testUnflagRecord() { @@ -515,7 +515,7 @@ class LDAPProviderTest extends \Test\TestCase { $ldapProvider = $this->getLDAPProvider($server); $ldapProvider->unflagRecord('existing_user'); - $this->assertTrue(TRUE); + $this->addToAssertionCount(1); } /** diff --git a/apps/workflowengine/tests/Check/AbstractStringCheckTest.php b/apps/workflowengine/tests/Check/AbstractStringCheckTest.php index b7051870115..70f8f79146a 100644 --- a/apps/workflowengine/tests/Check/AbstractStringCheckTest.php +++ b/apps/workflowengine/tests/Check/AbstractStringCheckTest.php @@ -96,6 +96,8 @@ class AbstractStringCheckTest extends \Test\TestCase { /** @var \OCA\WorkflowEngine\Check\AbstractStringCheck $check */ $check->validateCheck($operator, $value); + + $this->addToAssertionCount(1); } public function dataValidateCheckInvalid() { diff --git a/apps/workflowengine/tests/Check/RequestTimeTest.php b/apps/workflowengine/tests/Check/RequestTimeTest.php index 7249f5109f2..519b5112f3f 100644 --- a/apps/workflowengine/tests/Check/RequestTimeTest.php +++ b/apps/workflowengine/tests/Check/RequestTimeTest.php @@ -129,6 +129,7 @@ class RequestTimeTest extends \Test\TestCase { public function testValidateCheck($operator, $value) { $check = new \OCA\WorkflowEngine\Check\RequestTime($this->getL10NMock(), $this->timeFactory); $check->validateCheck($operator, $value); + $this->addToAssertionCount(1); } public function dataValidateCheckInvalid() { |