Skip to content

Commit

Permalink
Fix course length (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
lsolesen committed Dec 4, 2018
1 parent cabccb0 commit ac8b456
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
phpunit.xml
vendor
composer.phar
4 changes: 2 additions & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ public function createNewRegistrations(array $registrations)
$reg = $xml->addChild('Tilmelding');
foreach ($registration as $key => $value) {
foreach (array('.Fastnet', '.Mobil', '.ArbejdeTlf') as $variable) {
if (strpos($key, '.Fastnet') !== false) {
if (strpos($key, $variable) !== false) {
$value = $this->getUtilityClass()->fixPhoneNumber($value);
}
}
foreach (array('.Kursus', '.Email') as $variable) {
foreach (array('Kursus', '.Email') as $variable) {
if (strpos($key, $variable) !== false) {
$value = substr($value, 0, 50);
}
Expand Down
8 changes: 4 additions & 4 deletions tests/RegistrationRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,16 @@ public function setUp()
'Voksen.Lokalby' => 'Grejs',
'Voksen.Postnr' => '7100',
'Voksen.Bynavn' => 'Vejle',
'Voksen.Fastnet' => '75820811',
'Voksen.Fastnet' => '60652045/30374685',
'Voksen.FastnetBeskyttet' => 0, // 0 = No, 1 = Yes
'Voksen.Mobil' => '75820811',
'Voksen.Mobil' => '60652045/30374685',
'Voksen.MobilBeskyttet' => 0, // 0 = No, 1 = Yes
'Voksen.Email' => 'kontor@vih.dk',
'Voksen.Land' => 'Danmark',
),
array(
'Kartotek' => 'T3',
'Kursus' => 'Forårskursus 18/19',
'Kursus' => 'Forårskursus 2019 (24 uger) - KUN ENKELTE PIGEPLADSER TILBAGE',
// The following can be repeated for Mor, Far, Voksen
'Elev.Fornavn' => 'Ole',
'Elev.Efternavn' => 'Damgård',
Expand All @@ -125,7 +125,7 @@ public function setUp()
'Voksen.Bynavn' => 'Vejle',
'Voksen.Fastnet' => '+45 75 82 08 11',
'Voksen.FastnetBeskyttet' => 0, // 0 = No, 1 = Yes
'Voksen.Mobil' => '75820811',
'Voksen.Mobil' => '+45 75 82 08 11',
'Voksen.MobilBeskyttet' => 0, // 0 = No, 1 = Yes
'Voksen.Email' => 'kontor@vih.dk',
'Voksen.Land' => 'Denmark',
Expand Down

0 comments on commit ac8b456

Please sign in to comment.