From e3d967f73270f2a49edc3424e9cab6fe6e4c7b16 Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Thu, 31 Mar 2022 18:23:02 +0000 Subject: Test metadata equality Signed-off-by: Christopher Ng --- .../tests/integration/UserMigration/ContactsMigratorTest.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'apps') 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) { -- cgit v1.2.3