mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Fix risky tests without assertions
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
24af5c20bd
commit
bf2be08c9f
45 changed files with 107 additions and 67 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ class CalendarTest extends TestCase {
|
|||
->with(666, $propPatch);
|
||||
}
|
||||
$c->propPatch($propPatch);
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ class CustomPropertiesBackendTest extends \Test\TestCase {
|
|||
);
|
||||
|
||||
// no exception, soft fail
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -383,6 +383,8 @@ class FilesPluginTest extends TestCase {
|
|||
$propFind,
|
||||
$node
|
||||
);
|
||||
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
public function testUpdateProps() {
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,5 +136,6 @@ class OCSShareAPIMiddlewareTest extends \Test\TestCase {
|
|||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$this->middleware->afterController($controller, 'foo', $response);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,6 +39,6 @@ class ExpireTrashTest extends \Test\TestCase {
|
|||
|
||||
/** @var \OC\BackgroundJob\JobList $jobList */
|
||||
$backgroundJob->execute($jobList);
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,6 +39,6 @@ class ExpireTest extends TestCase {
|
|||
$command = new Expire('test');
|
||||
$command->handle();
|
||||
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,6 +39,6 @@ class ExpireTest extends TestCase {
|
|||
$command = new Expire($this->getUniqueID('test'), '');
|
||||
$command->handle();
|
||||
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class PasswordConfirmationMiddlewareTest extends TestCase {
|
|||
|
||||
/**
|
||||
* @PasswordConfirmationRequired
|
||||
* @dataProvider testProvider
|
||||
* @dataProvider dataProvider
|
||||
*/
|
||||
public function testAnnotation($backend, $lastConfirm, $currentTime, $exception) {
|
||||
$this->reflector->reflect(__CLASS__, __FUNCTION__);
|
||||
|
|
@ -116,7 +116,7 @@ class PasswordConfirmationMiddlewareTest extends TestCase {
|
|||
$this->assertSame($exception, $thrown);
|
||||
}
|
||||
|
||||
public function testProvider() {
|
||||
public function dataProvider() {
|
||||
return [
|
||||
['foo', 2000, 4000, true],
|
||||
['foo', 2000, 3000, false],
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ class SameSiteCookieMiddlewareTest extends TestCase {
|
|||
->willReturn('/ocs/v2.php');
|
||||
|
||||
$this->middleware->beforeController($this->createMock(Controller::class), 'foo');
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
public function testBeforeControllerIndexHasAnnotation() {
|
||||
|
|
@ -66,6 +67,7 @@ class SameSiteCookieMiddlewareTest extends TestCase {
|
|||
->willReturn(true);
|
||||
|
||||
$this->middleware->beforeController($this->createMock(Controller::class), 'foo');
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
public function testBeforeControllerIndexNoAnnotationPassingCheck() {
|
||||
|
|
@ -80,6 +82,7 @@ class SameSiteCookieMiddlewareTest extends TestCase {
|
|||
->willReturn(true);
|
||||
|
||||
$this->middleware->beforeController($this->createMock(Controller::class), 'foo');
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
public function testBeforeControllerIndexNoAnnotationFailingCheck() {
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ class SecurityMiddlewareTest extends \Test\TestCase {
|
|||
// add assertion if everything should work fine otherwise phpunit will
|
||||
// complain
|
||||
if ($status === 0) {
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -265,7 +265,7 @@ class SecurityMiddlewareTest extends \Test\TestCase {
|
|||
if($shouldFail) {
|
||||
$this->expectException(SecurityException::class);
|
||||
} else {
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
$this->reader->reflect(__CLASS__, $method);
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ class StoreTest extends TestCase {
|
|||
$session = $this->createMock(ISession::class);
|
||||
|
||||
$this->store->setSession($session);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
public function testGetLoginCredentialsNoTokenProvider() {
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ class EntryTest extends TestCase {
|
|||
|
||||
public function testSetId() {
|
||||
$this->entry->setId(123);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
public function testSetGetFullName() {
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class ConnectionTest extends \Test\TestCase {
|
|||
public function assertTableExist($table) {
|
||||
if ($this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
|
||||
// sqlite removes the tables after closing the DB
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
} else {
|
||||
$this->assertTrue($this->connection->tableExists($table), 'Table ' . $table . ' exists.');
|
||||
}
|
||||
|
|
@ -70,7 +70,7 @@ class ConnectionTest extends \Test\TestCase {
|
|||
public function assertTableNotExist($table) {
|
||||
if ($this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
|
||||
// sqlite removes the tables after closing the DB
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
} else {
|
||||
$this->assertFalse($this->connection->tableExists($table), 'Table ' . $table . " doesn't exist.");
|
||||
}
|
||||
|
|
@ -195,5 +195,7 @@ class ConnectionTest extends \Test\TestCase {
|
|||
], [
|
||||
'textfield' => 'foo'
|
||||
]);
|
||||
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class DBSchemaTest extends TestCase {
|
|||
$platform = \OC::$server->getDatabaseConnection()->getDatabasePlatform();
|
||||
if ($platform instanceof SqlitePlatform) {
|
||||
// sqlite removes the tables after closing the DB
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
} else {
|
||||
$this->assertFalse(OC_DB::tableExists($table), 'Table ' . $table . ' exists.');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class MDB2SchemaManagerTest extends \Test\TestCase {
|
|||
$connection->executeUpdate('insert into `*PREFIX*table` values (?)', array('123'));
|
||||
$manager->updateDbFromStructure(__DIR__ . '/ts-autoincrement-after.xml');
|
||||
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ class MigratorTest extends \Test\TestCase {
|
|||
|
||||
$migrator->checkMigrate($endSchema);
|
||||
$migrator->migrate($endSchema);
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
public function testUpgradeDifferentPrefix() {
|
||||
|
|
@ -151,7 +151,7 @@ class MigratorTest extends \Test\TestCase {
|
|||
|
||||
$migrator->checkMigrate($endSchema);
|
||||
$migrator->migrate($endSchema);
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
|
||||
$this->config->setSystemValue('dbtableprefix', $oldTablePrefix);
|
||||
}
|
||||
|
|
@ -169,7 +169,7 @@ class MigratorTest extends \Test\TestCase {
|
|||
$this->connection->insert($this->tableName, array('id' => 2, 'name' => 'qwerty'));
|
||||
$this->fail('Expected duplicate key insert to fail');
|
||||
} catch (DBALException $e) {
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -191,7 +191,7 @@ class MigratorTest extends \Test\TestCase {
|
|||
$migrator->checkMigrate($endSchema);
|
||||
$migrator->migrate($endSchema);
|
||||
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
public function testReservedKeywords() {
|
||||
|
|
@ -213,7 +213,7 @@ class MigratorTest extends \Test\TestCase {
|
|||
$migrator->checkMigrate($endSchema);
|
||||
$migrator->migrate($endSchema);
|
||||
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
public function testAddingForeignKey() {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class MySqlMigrationTest extends \Test\TestCase {
|
|||
$manager = new \OC\DB\MDB2SchemaManager($this->connection);
|
||||
$manager->updateDbFromStructure(__DIR__ . '/testschema.xml');
|
||||
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1137,7 +1137,7 @@ class QueryBuilderTest extends \Test\TestCase {
|
|||
$qB->getLastInsertId();
|
||||
$this->fail('getLastInsertId() should throw an exception, when being called before insert()');
|
||||
} catch (\BadMethodCallException $e) {
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
$qB->insert('properties')
|
||||
|
|
@ -1163,7 +1163,7 @@ class QueryBuilderTest extends \Test\TestCase {
|
|||
$qB->getLastInsertId();
|
||||
$this->fail('getLastInsertId() should throw an exception, when being called after delete()');
|
||||
} catch (\BadMethodCallException $e) {
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class SqliteMigrationTest extends \Test\TestCase {
|
|||
$manager = new \OC\DB\MDB2SchemaManager($this->connection);
|
||||
$manager->updateDbFromStructure(__DIR__ . '/testschema.xml');
|
||||
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ use OC\Federation\CloudId;
|
|||
use Test\TestCase;
|
||||
|
||||
class CloudIdTest extends TestCase {
|
||||
public function testGetDisplayCloudIdProvider() {
|
||||
public function dataGetDisplayCloudId() {
|
||||
return [
|
||||
['test@example.com', 'test@example.com'],
|
||||
['test@http://example.com', 'test@example.com'],
|
||||
|
|
@ -34,7 +34,7 @@ class CloudIdTest extends TestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* @dataProvider testGetDisplayCloudIdProvider
|
||||
* @dataProvider dataGetDisplayCloudId
|
||||
*
|
||||
* @param string $id
|
||||
* @param string $display
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class CacheJailTest extends CacheTest {
|
|||
|
||||
function testGetIncomplete() {
|
||||
//not supported
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
function testMoveFromJail() {
|
||||
|
|
|
|||
|
|
@ -87,6 +87,8 @@ class PathVerificationTest extends \Test\TestCase {
|
|||
if (!$connection->supports4ByteText()) {
|
||||
$this->expectException(InvalidPathException::class);
|
||||
$this->expectExceptionMessage('File name contains at least one invalid character');
|
||||
} else {
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
$this->view->verifyPath('', $fileName);
|
||||
|
|
@ -161,7 +163,7 @@ class PathVerificationTest extends \Test\TestCase {
|
|||
|
||||
self::invokePrivate($storage, 'verifyPosixPath', [$fileName]);
|
||||
// nothing thrown
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
public function providesValidPosixPaths() {
|
||||
|
|
|
|||
|
|
@ -106,6 +106,7 @@ class LocalTest extends Storage {
|
|||
$storage = new \OC\Files\Storage\Local(['datadir' => $subDir1]);
|
||||
|
||||
$storage->file_put_contents('sym/foo', 'bar');
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -157,5 +157,7 @@ abstract class Backend extends \Test\TestCase {
|
|||
|
||||
$this->backend->createGroup($group);
|
||||
$this->backend->createGroup($group);
|
||||
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ class BasicEmitterTest extends \Test\TestCase {
|
|||
$this->emitter->removeListener('Test', 'test', $listener);
|
||||
$this->emitter->emitEvent('Test', 'test');
|
||||
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
public function testRemoveWildcardListener() {
|
||||
|
|
@ -172,7 +172,7 @@ class BasicEmitterTest extends \Test\TestCase {
|
|||
$this->emitter->removeListener('Test', 'test');
|
||||
$this->emitter->emitEvent('Test', 'test');
|
||||
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
public function testRemoveWildcardMethod() {
|
||||
|
|
@ -185,7 +185,7 @@ class BasicEmitterTest extends \Test\TestCase {
|
|||
$this->emitter->emitEvent('Test', 'test');
|
||||
$this->emitter->emitEvent('Test', 'foo');
|
||||
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
public function testRemoveWildcardScope() {
|
||||
|
|
@ -198,7 +198,7 @@ class BasicEmitterTest extends \Test\TestCase {
|
|||
$this->emitter->emitEvent('Test', 'test');
|
||||
$this->emitter->emitEvent('Bar', 'test');
|
||||
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
public function testRemoveWildcardScopeAndMethod() {
|
||||
|
|
@ -213,7 +213,7 @@ class BasicEmitterTest extends \Test\TestCase {
|
|||
$this->emitter->emitEvent('Test', 'foo');
|
||||
$this->emitter->emitEvent('Bar', 'foo');
|
||||
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -231,7 +231,7 @@ class BasicEmitterTest extends \Test\TestCase {
|
|||
$this->emitter->removeListener('Test', 'test', $listener1);
|
||||
$this->emitter->emitEvent('Test', 'test');
|
||||
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -246,7 +246,7 @@ class BasicEmitterTest extends \Test\TestCase {
|
|||
$this->emitter->removeListener('Test', 'foo', $listener);
|
||||
$this->emitter->emitEvent('Test', 'test');
|
||||
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -261,7 +261,7 @@ class BasicEmitterTest extends \Test\TestCase {
|
|||
$this->emitter->removeListener('Bar', 'test', $listener);
|
||||
$this->emitter->emitEvent('Test', 'test');
|
||||
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -275,6 +275,6 @@ class BasicEmitterTest extends \Test\TestCase {
|
|||
$this->emitter->removeListener('Bar', 'test', $listener);
|
||||
$this->emitter->emitEvent('Test', 'test');
|
||||
|
||||
$this->assertTrue(true);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,8 +67,10 @@ class InfoXmlTest extends TestCase {
|
|||
$applicationClassName = \OCP\AppFramework\App::buildAppNamespace($app) . '\\AppInfo\\Application';
|
||||
if (class_exists($applicationClassName)) {
|
||||
$application = new $applicationClassName();
|
||||
$this->addToAssertionCount(1);
|
||||
} else {
|
||||
$application = new \OCP\AppFramework\App($app);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
if (isset($appInfo['background-jobs'])) {
|
||||
|
|
|
|||
|
|
@ -64,5 +64,6 @@ class FileAccessHelperTest extends TestCase {
|
|||
|
||||
public function testAssertDirectoryExists() {
|
||||
$this->fileAccessHelper->assertDirectoryExists(\OC::$server->getTempManager()->getTemporaryFolder('/testfolder/'));
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ class ValidatorTest extends TestCase {
|
|||
'path' => 'path/to/test.txt',
|
||||
],
|
||||
]);
|
||||
$this->addToAssertionCount(2);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ class ContentSecurityPolicyManagerTest extends \Test\TestCase {
|
|||
|
||||
public function testAddDefaultPolicy() {
|
||||
$this->contentSecurityPolicyManager->addDefaultPolicy(new \OCP\AppFramework\Http\ContentSecurityPolicy());
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
public function testGetDefaultPolicyWithPolicies() {
|
||||
|
|
|
|||
|
|
@ -779,6 +779,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
|
||||
try {
|
||||
self::invokePrivate($this->manager, 'validateExpirationDate', [$share]);
|
||||
$this->addToAssertionCount(1);
|
||||
} catch (\OCP\Share\Exceptions\GenericShareException $e) {
|
||||
$this->assertEquals('Cannot set expiration date more than 3 days in the future', $e->getMessage());
|
||||
$this->assertEquals('Cannot set expiration date more than 3 days in the future', $e->getHint());
|
||||
|
|
@ -1008,6 +1009,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
->willReturn([]);
|
||||
|
||||
self::invokePrivate($this->manager, 'userCreateChecks', [$share]);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1143,6 +1145,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
->willReturn([$share2]);
|
||||
|
||||
self::invokePrivate($this->manager, 'userCreateChecks', [$share]);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1237,6 +1240,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
]));
|
||||
|
||||
self::invokePrivate($this->manager, 'groupCreateChecks', [$share]);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1292,6 +1296,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
]));
|
||||
|
||||
self::invokePrivate($this->manager, 'groupCreateChecks', [$share]);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1360,6 +1365,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
]));
|
||||
|
||||
self::invokePrivate($this->manager, 'linkCreateChecks', [$share]);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
public function testLinkCreateChecksReadOnly() {
|
||||
|
|
@ -1375,6 +1381,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
]));
|
||||
|
||||
self::invokePrivate($this->manager, 'linkCreateChecks', [$share]);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1407,12 +1414,14 @@ class ManagerTest extends \Test\TestCase {
|
|||
$this->mountManager->method('findIn')->with('path')->willReturn([$mount]);
|
||||
|
||||
self::invokePrivate($this->manager, 'pathCreateChecks', [$path]);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
public function testPathCreateChecksContainsNoFolder() {
|
||||
$path = $this->createMock(File::class);
|
||||
|
||||
self::invokePrivate($this->manager, 'pathCreateChecks', [$path]);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
public function dataIsSharingDisabledForUser() {
|
||||
|
|
@ -2744,6 +2753,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
$this->defaultProvider->method('move')->with($share, 'recipient')->will($this->returnArgument(0));
|
||||
|
||||
$this->manager->moveShare($share, 'recipient');
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -2801,6 +2811,7 @@ class ManagerTest extends \Test\TestCase {
|
|||
$this->defaultProvider->method('move')->with($share, 'recipient')->will($this->returnArgument(0));
|
||||
|
||||
$this->manager->moveShare($share, 'recipient');
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ class RegistryTest extends TestCase {
|
|||
$exception = new Exception('test');
|
||||
|
||||
$this->registry->delegateReport($exception);
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
public function testDelegateToAll() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue