Kaynağa Gözat

Fix risky tests without assertions

Signed-off-by: Joas Schilling <coding@schilljs.com>
tags/v14.0.0beta1
Joas Schilling 6 yıl önce
ebeveyn
işleme
bf2be08c9f
No account linked to committer's email address
45 değiştirilmiş dosya ile 107 ekleme ve 67 silme
  1. 1
    1
      apps/dav/tests/unit/AppInfo/ApplicationTest.php
  2. 2
    2
      apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php
  3. 1
    1
      apps/dav/tests/unit/CalDAV/CalendarTest.php
  4. 1
    1
      apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php
  5. 1
    1
      apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
  6. 2
    0
      apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php
  7. 3
    3
      apps/encryption/tests/Hooks/UserHooksTest.php
  8. 1
    1
      apps/encryption/tests/RecoveryTest.php
  9. 13
    13
      apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php
  10. 5
    1
      apps/files_sharing/tests/ApiTest.php
  11. 3
    3
      apps/files_sharing/tests/External/ScannerTest.php
  12. 1
    1
      apps/files_sharing/tests/LockingTest.php
  13. 1
    0
      apps/files_sharing/tests/Middleware/OCSShareAPIMiddlewareTest.php
  14. 1
    1
      apps/files_trashbin/tests/BackgroundJob/ExpireTrashTest.php
  15. 1
    1
      apps/files_trashbin/tests/Command/ExpireTest.php
  16. 1
    0
      apps/files_trashbin/tests/StorageTest.php
  17. 1
    1
      apps/files_versions/tests/Command/ExpireTest.php
  18. 2
    2
      apps/provisioning_api/tests/Controller/AppConfigControllerTest.php
  19. 4
    4
      apps/user_ldap/tests/LDAPProviderTest.php
  20. 2
    0
      apps/workflowengine/tests/Check/AbstractStringCheckTest.php
  21. 1
    0
      apps/workflowengine/tests/Check/RequestTimeTest.php
  22. 2
    2
      tests/lib/AppFramework/Middleware/Security/PasswordConfirmationMiddlewareTest.php
  23. 3
    0
      tests/lib/AppFramework/Middleware/Security/SameSiteCookieMiddlewareTest.php
  24. 2
    2
      tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php
  25. 1
    0
      tests/lib/Authentication/LoginCredentials/StoreTest.php
  26. 1
    0
      tests/lib/Contacts/ContactsMenu/EntryTest.php
  27. 4
    2
      tests/lib/DB/ConnectionTest.php
  28. 1
    1
      tests/lib/DB/DBSchemaTest.php
  29. 1
    1
      tests/lib/DB/MDB2SchemaManagerTest.php
  30. 5
    5
      tests/lib/DB/MigratorTest.php
  31. 1
    1
      tests/lib/DB/MySqlMigrationTest.php
  32. 2
    2
      tests/lib/DB/QueryBuilder/QueryBuilderTest.php
  33. 1
    1
      tests/lib/DB/SqliteMigrationTest.php
  34. 2
    2
      tests/lib/Federation/CloudIdTest.php
  35. 1
    1
      tests/lib/Files/Cache/Wrapper/CacheJailTest.php
  36. 3
    1
      tests/lib/Files/PathVerificationTest.php
  37. 1
    0
      tests/lib/Files/Storage/LocalTest.php
  38. 2
    0
      tests/lib/Group/Backend.php
  39. 9
    9
      tests/lib/Hooks/BasicEmitterTest.php
  40. 2
    0
      tests/lib/InfoXmlTest.php
  41. 1
    0
      tests/lib/IntegrityCheck/Helpers/FileAccessHelperTest.php
  42. 1
    0
      tests/lib/RichObjectStrings/ValidatorTest.php
  43. 1
    0
      tests/lib/Security/CSP/ContentSecurityPolicyManagerTest.php
  44. 11
    0
      tests/lib/Share20/ManagerTest.php
  45. 1
    0
      tests/lib/Support/CrashReport/RegistryTest.php

+ 1
- 1
apps/dav/tests/unit/AppInfo/ApplicationTest.php Dosyayı Görüntüle

@@ -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);
}
}

+ 2
- 2
apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php Dosyayı Görüntüle

@@ -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) {

+ 1
- 1
apps/dav/tests/unit/CalDAV/CalendarTest.php Dosyayı Görüntüle

@@ -183,7 +183,7 @@ class CalendarTest extends TestCase {
->with(666, $propPatch);
}
$c->propPatch($propPatch);
$this->assertTrue(true);
$this->addToAssertionCount(1);
}

/**

+ 1
- 1
apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php Dosyayı Görüntüle

@@ -174,7 +174,7 @@ class CustomPropertiesBackendTest extends \Test\TestCase {
);

// no exception, soft fail
$this->assertTrue(true);
$this->addToAssertionCount(1);
}

/**

+ 1
- 1
apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php Dosyayı Görüntüle

@@ -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);
}

/**

+ 2
- 0
apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php Dosyayı Görüntüle

@@ -383,6 +383,8 @@ class FilesPluginTest extends TestCase {
$propFind,
$node
);

$this->addToAssertionCount(1);
}

public function testUpdateProps() {

+ 3
- 3
apps/encryption/tests/Hooks/UserHooksTest.php Dosyayı Görüntüle

@@ -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() {

+ 1
- 1
apps/encryption/tests/RecoveryTest.php Dosyayı Görüntüle

@@ -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() {

+ 13
- 13
apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php Dosyayı Görüntüle

@@ -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);
}
}

+ 5
- 1
apps/files_sharing/tests/ApiTest.php Dosyayı Görüntüle

@@ -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);
}

/**

+ 3
- 3
apps/files_sharing/tests/External/ScannerTest.php Dosyayı Görüntüle

@@ -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);
}
}

+ 1
- 1
apps/files_sharing/tests/LockingTest.php Dosyayı Görüntüle

@@ -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);
}
}

+ 1
- 0
apps/files_sharing/tests/Middleware/OCSShareAPIMiddlewareTest.php Dosyayı Görüntüle

@@ -136,5 +136,6 @@ class OCSShareAPIMiddlewareTest extends \Test\TestCase {
->disableOriginalConstructor()
->getMock();
$this->middleware->afterController($controller, 'foo', $response);
$this->addToAssertionCount(1);
}
}

+ 1
- 1
apps/files_trashbin/tests/BackgroundJob/ExpireTrashTest.php Dosyayı Görüntüle

@@ -39,6 +39,6 @@ class ExpireTrashTest extends \Test\TestCase {

/** @var \OC\BackgroundJob\JobList $jobList */
$backgroundJob->execute($jobList);
$this->assertTrue(true);
$this->addToAssertionCount(1);
}
}

+ 1
- 1
apps/files_trashbin/tests/Command/ExpireTest.php Dosyayı Görüntüle

@@ -39,6 +39,6 @@ class ExpireTest extends TestCase {
$command = new Expire('test');
$command->handle();

$this->assertTrue(true);
$this->addToAssertionCount(1);
}
}

+ 1
- 0
apps/files_trashbin/tests/StorageTest.php Dosyayı Görüntüle

@@ -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);
}
}
}

+ 1
- 1
apps/files_versions/tests/Command/ExpireTest.php Dosyayı Görüntüle

@@ -39,6 +39,6 @@ class ExpireTest extends TestCase {
$command = new Expire($this->getUniqueID('test'), '');
$command->handle();

$this->assertTrue(true);
$this->addToAssertionCount(1);
}
}

+ 2
- 2
apps/provisioning_api/tests/Controller/AppConfigControllerTest.php Dosyayı Görüntüle

@@ -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() {

+ 4
- 4
apps/user_ldap/tests/LDAPProviderTest.php Dosyayı Görüntüle

@@ -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);
}

/**

+ 2
- 0
apps/workflowengine/tests/Check/AbstractStringCheckTest.php Dosyayı Görüntüle

@@ -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() {

+ 1
- 0
apps/workflowengine/tests/Check/RequestTimeTest.php Dosyayı Görüntüle

@@ -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() {

+ 2
- 2
tests/lib/AppFramework/Middleware/Security/PasswordConfirmationMiddlewareTest.php Dosyayı Görüntüle

@@ -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],

+ 3
- 0
tests/lib/AppFramework/Middleware/Security/SameSiteCookieMiddlewareTest.php Dosyayı Görüntüle

@@ -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() {

+ 2
- 2
tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php Dosyayı Görüntüle

@@ -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);

+ 1
- 0
tests/lib/Authentication/LoginCredentials/StoreTest.php Dosyayı Görüntüle

@@ -79,6 +79,7 @@ class StoreTest extends TestCase {
$session = $this->createMock(ISession::class);

$this->store->setSession($session);
$this->addToAssertionCount(1);
}

public function testGetLoginCredentialsNoTokenProvider() {

+ 1
- 0
tests/lib/Contacts/ContactsMenu/EntryTest.php Dosyayı Görüntüle

@@ -41,6 +41,7 @@ class EntryTest extends TestCase {

public function testSetId() {
$this->entry->setId(123);
$this->addToAssertionCount(1);
}

public function testSetGetFullName() {

+ 4
- 2
tests/lib/DB/ConnectionTest.php Dosyayı Görüntüle

@@ -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);
}
}

+ 1
- 1
tests/lib/DB/DBSchemaTest.php Dosyayı Görüntüle

@@ -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.');
}

+ 1
- 1
tests/lib/DB/MDB2SchemaManagerTest.php Dosyayı Görüntüle

@@ -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);
}

}

+ 5
- 5
tests/lib/DB/MigratorTest.php Dosyayı Görüntüle

@@ -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() {

+ 1
- 1
tests/lib/DB/MySqlMigrationTest.php Dosyayı Görüntüle

@@ -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);
}

}

+ 2
- 2
tests/lib/DB/QueryBuilder/QueryBuilderTest.php Dosyayı Görüntüle

@@ -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);
}
}


+ 1
- 1
tests/lib/DB/SqliteMigrationTest.php Dosyayı Görüntüle

@@ -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);
}

}

+ 2
- 2
tests/lib/Federation/CloudIdTest.php Dosyayı Görüntüle

@@ -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

+ 1
- 1
tests/lib/Files/Cache/Wrapper/CacheJailTest.php Dosyayı Görüntüle

@@ -79,7 +79,7 @@ class CacheJailTest extends CacheTest {

function testGetIncomplete() {
//not supported
$this->assertTrue(true);
$this->addToAssertionCount(1);
}

function testMoveFromJail() {

+ 3
- 1
tests/lib/Files/PathVerificationTest.php Dosyayı Görüntüle

@@ -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() {

+ 1
- 0
tests/lib/Files/Storage/LocalTest.php Dosyayı Görüntüle

@@ -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);
}
}


+ 2
- 0
tests/lib/Group/Backend.php Dosyayı Görüntüle

@@ -157,5 +157,7 @@ abstract class Backend extends \Test\TestCase {

$this->backend->createGroup($group);
$this->backend->createGroup($group);

$this->addToAssertionCount(1);
}
}

+ 9
- 9
tests/lib/Hooks/BasicEmitterTest.php Dosyayı Görüntüle

@@ -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);
}
}

+ 2
- 0
tests/lib/InfoXmlTest.php Dosyayı Görüntüle

@@ -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'])) {

+ 1
- 0
tests/lib/IntegrityCheck/Helpers/FileAccessHelperTest.php Dosyayı Görüntüle

@@ -64,5 +64,6 @@ class FileAccessHelperTest extends TestCase {

public function testAssertDirectoryExists() {
$this->fileAccessHelper->assertDirectoryExists(\OC::$server->getTempManager()->getTemporaryFolder('/testfolder/'));
$this->addToAssertionCount(1);
}
}

+ 1
- 0
tests/lib/RichObjectStrings/ValidatorTest.php Dosyayı Görüntüle

@@ -49,6 +49,7 @@ class ValidatorTest extends TestCase {
'path' => 'path/to/test.txt',
],
]);
$this->addToAssertionCount(2);
}

}

+ 1
- 0
tests/lib/Security/CSP/ContentSecurityPolicyManagerTest.php Dosyayı Görüntüle

@@ -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() {

+ 11
- 0
tests/lib/Share20/ManagerTest.php Dosyayı Görüntüle

@@ -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);
}

/**

+ 1
- 0
tests/lib/Support/CrashReport/RegistryTest.php Dosyayı Görüntüle

@@ -47,6 +47,7 @@ class RegistryTest extends TestCase {
$exception = new Exception('test');

$this->registry->delegateReport($exception);
$this->addToAssertionCount(1);
}

public function testDelegateToAll() {

Loading…
İptal
Kaydet