Fix the failing unit tests

refactor the codestyle for the tests we wanted to keep
This commit is contained in:
2017-10-17 06:41:19 -04:00
parent 8ae78ef047
commit 0cc8361929
40 changed files with 1395 additions and 5439 deletions

View File

@@ -62,12 +62,12 @@ class Parser {
}
$mode = self::MODE_NO_DATA;
} else if ($mode === self::MODE_TUNE_BODY) {
} elseif ($mode === self::MODE_TUNE_BODY) {
$music .= $line . PHP_EOL;
} else if (preg_match(self::LN_VERSION, $line)) {
} elseif (preg_match(self::LN_VERSION, $line)) {
//this line might contain the abc version.
//What do we want to do with it?
} else if (preg_match(self::LN_FIELD, $line) || $inHistory) {
} elseif (preg_match(self::LN_FIELD, $line) || $inHistory) {
if (preg_match(self::LN_FIELD, $line)) { $inHistory = FALSE; }
//split the line "key:data"
if($inHistory) {
@@ -87,7 +87,7 @@ class Parser {
$this->builder->setOnTune('X', $data);
} else if (preg_match($keys_for_Tunes, $key)) {
} elseif (preg_match($keys_for_Tunes, $key)) {
if ($key === 'H') {
$inHistory = TRUE;
} else {
@@ -102,7 +102,7 @@ class Parser {
} else {
$this->builder->appendToCollection($key, $data);
}
} else if($inTunes) {
} elseif($inTunes) {
if (in_array($key, self::SINGLE_VALUE_KEYS)) {
$this->builder->setOnTune($key, $data);
} else {
@@ -110,7 +110,7 @@ class Parser {
}
}
} else if (preg_match($keys_for_Settings, $key)) {
} elseif (preg_match($keys_for_Settings, $key)) {
if ($key === 'K' && $mode === self::MODE_TUNE_HEADER) {
$mode = self::MODE_TUNE_BODY;
}
@@ -126,7 +126,7 @@ class Parser {
} else {
$this->builder->appendToCollection($key, $data);
}
} else if($inTunes){
} elseif($inTunes){
if (in_array($key, self::SINGLE_VALUE_KEYS)) {
$this->builder->setOnSetting($key, $data);
} else {