Skip to content

Commit

Permalink
test: fix ContactsMigratorTest
Browse files Browse the repository at this point in the history
Signed-off-by: Anna Larch <[email protected]>
  • Loading branch information
miaulalala authored and backportbot[bot] committed Sep 23, 2024
1 parent 972877b commit ade574c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15,894 deletions.
32 changes: 21 additions & 11 deletions apps/dav/tests/integration/UserMigration/ContactsMigratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,30 @@ public function testImportExportAsset(string $userId, string $filename, string $
$exportMetadata = array_filter(['displayName' => $displayName, 'description' => $description]);

$this->assertEquals($importMetadata, $exportMetadata);
$this->assertEquals(count($importCards), count($exportCards));
$this->assertSameSize($importCards, $exportCards);

for ($i = 0; $i < count($importCards); ++$i) {
$this->assertNotEqualsCanonicalizing(
$this->getPropertiesChangedOnImport($importCards[$i]),
$this->getPropertiesChangedOnImport($exportCards[$i]),
);
$importProperties = [];
$exportProperties = [];
for ($i = 0, $iMax = count($importCards); $i < $iMax; ++$i) {
$importProperties[] = $this->getPropertiesChangedOnImport($importCards[$i]);
$exportProperties[] = $this->getPropertiesChangedOnImport($exportCards[$i]);
}

for ($i = 0; $i < count($importCards); ++$i) {
$this->assertEqualsCanonicalizing(
$this->getProperties($importCards[$i]),
$this->getProperties($exportCards[$i]),
);
$this->assertNotEqualsCanonicalizing(
$importProperties,
$exportProperties,
);

$importProperties = [];
$exportProperties = [];
for ($i = 0, $iMax = count($importCards); $i < $iMax; ++$i) {
$importProperties[] = $this->getProperties($importCards[$i]);
$exportProperties[] = $this->getProperties($exportCards[$i]);
}

$this->assertEqualsCanonicalizing(
$importProperties,
$exportProperties,
);
}
}
Loading

0 comments on commit ade574c

Please sign in to comment.