added account number field to user (#2671)

This commit is contained in:
Kevin Papst
2021-07-19 00:13:39 +02:00
committed by GitHub
parent 7d052eba00
commit 828b9c8b4a
12 changed files with 106 additions and 6 deletions

View File

@@ -32,15 +32,18 @@ class UserExporterTest extends TestCase
$userPreferenceExtractor = new UserPreferenceExtractor($this->createMock(EventDispatcherInterface::class));
$user = new User();
$user->setAccountNumber('F-747864');
$user->setUsername('test user');
$user->setAvatar('Lorem Ipsum');
$user->setTimezone('Europe/Berlin');
$user->setColor('#ececec');
$user->setAlias('Another name');
$user->setTitle('Mr. Title');
$user->setLanguage('de');
$user->setEmail('test@example.com');
$user->setEnabled(false);
$user->addRole(User::ROLE_TEAMLEAD);
$date = $user->getRegisteredAt();
$sut = new UserExporter($spreadsheetExporter, $annotationExtractor, $userPreferenceExtractor);
$spreadsheet = $sut->export([$user], new UserPreferenceDisplayEvent(UserPreferenceDisplayEvent::EXPORT));
@@ -55,6 +58,9 @@ class UserExporterTest extends TestCase
self::assertEquals('de', $worksheet->getCellByColumnAndRow(7, 2)->getValue());
self::assertEquals('Europe/Berlin', $worksheet->getCellByColumnAndRow(8, 2)->getValue());
self::assertFalse($worksheet->getCellByColumnAndRow(9, 2)->getValue());
self::assertEquals($date->format('Y-m-d H:i'), $worksheet->getCellByColumnAndRow(10, 2)->getFormattedValue());
self::assertEquals('ROLE_TEAMLEAD;ROLE_USER', $worksheet->getCellByColumnAndRow(11, 2)->getValue());
self::assertEquals('#ececec', $worksheet->getCellByColumnAndRow(12, 2)->getValue());
self::assertEquals('F-747864', $worksheet->getCellByColumnAndRow(13, 2)->getValue());
}
}