diff options
author | Christopher Ng <chrng8@gmail.com> | 2022-03-31 18:23:02 +0000 |
---|---|---|
committer | Christopher Ng <chrng8@gmail.com> | 2022-03-31 18:23:02 +0000 |
commit | e3d967f73270f2a49edc3424e9cab6fe6e4c7b16 (patch) | |
tree | 97e2130daff29cc06eb5c9908b56f7ee9467daaf /apps | |
parent | 53c9edc64d2fe936f1f93bd4cb17120abe3bbe89 (diff) | |
download | nextcloud-server-e3d967f73270f2a49edc3424e9cab6fe6e4c7b16.tar.gz nextcloud-server-e3d967f73270f2a49edc3424e9cab6fe6e4c7b16.zip |
Test metadata equality
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/tests/integration/UserMigration/ContactsMigratorTest.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/dav/tests/integration/UserMigration/ContactsMigratorTest.php b/apps/dav/tests/integration/UserMigration/ContactsMigratorTest.php index 89c2bb02556..568b83396ba 100644 --- a/apps/dav/tests/integration/UserMigration/ContactsMigratorTest.php +++ b/apps/dav/tests/integration/UserMigration/ContactsMigratorTest.php @@ -110,10 +110,10 @@ class ContactsMigratorTest extends TestCase { /** * @dataProvider dataAssets * - * @param array{displayName: string, description?: string} $metadata + * @param array{displayName: string, description?: string} $importMetadata * @param VCard[] $importCards */ - public function testImportExportAsset(string $userId, string $filename, string $initialAddressBookUri, array $metadata, array $importCards): void { + public function testImportExportAsset(string $userId, string $filename, string $initialAddressBookUri, array $importMetadata, array $importCards): void { $user = $this->userManager->createUser($userId, 'topsecretpassword'); foreach ($importCards as $importCard) { @@ -121,14 +121,16 @@ class ContactsMigratorTest extends TestCase { $this->assertEmpty($problems); } - $this->invokePrivate($this->migrator, 'importAddressBook', [$user, $filename, $initialAddressBookUri, $metadata, $importCards, $this->output]); + $this->invokePrivate($this->migrator, 'importAddressBook', [$user, $filename, $initialAddressBookUri, $importMetadata, $importCards, $this->output]); $addressBookExports = $this->invokePrivate($this->migrator, 'getAddressBookExports', [$user, $this->output]); $this->assertCount(1, $addressBookExports); /** @var VCard[] $exportCards */ - ['vCards' => $exportCards] = reset($addressBookExports); + ['displayName' => $displayName, 'description' => $description, 'vCards' => $exportCards] = reset($addressBookExports); + $exportMetadata = array_filter(['displayName' => $displayName, 'description' => $description]); + $this->assertEquals($importMetadata, $exportMetadata); $this->assertEquals(count($importCards), count($exportCards)); for ($i = 0; $i < count($importCards); ++$i) { |