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 committed Sep 19, 2024
1 parent 086b11f commit c2e6453
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 c2e6453

Please sign in to comment.