aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/integration/UserMigration/ContactsMigratorTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/tests/integration/UserMigration/ContactsMigratorTest.php')
-rw-r--r--apps/dav/tests/integration/UserMigration/ContactsMigratorTest.php36
1 files changed, 23 insertions, 13 deletions
diff --git a/apps/dav/tests/integration/UserMigration/ContactsMigratorTest.php b/apps/dav/tests/integration/UserMigration/ContactsMigratorTest.php
index 17d4cf21536..9ae1ca28501 100644
--- a/apps/dav/tests/integration/UserMigration/ContactsMigratorTest.php
+++ b/apps/dav/tests/integration/UserMigration/ContactsMigratorTest.php
@@ -44,7 +44,7 @@ class ContactsMigratorTest extends TestCase {
$this->output = $this->createMock(OutputInterface::class);
}
- public function dataAssets(): array {
+ public static function dataAssets(): array {
return array_map(
function (string $filename) {
$vCardSplitter = new VCardSplitter(
@@ -91,11 +91,11 @@ class ContactsMigratorTest extends TestCase {
}
/**
- * @dataProvider dataAssets
*
* @param array{displayName: string, description?: string} $importMetadata
* @param VCard[] $importCards
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataAssets')]
public function testImportExportAsset(string $userId, string $filename, string $initialAddressBookUri, array $importMetadata, array $importCards): void {
$user = $this->userManager->createUser($userId, 'topsecretpassword');
@@ -114,20 +114,30 @@ class ContactsMigratorTest extends TestCase {
$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,
+ );
}
}