Commit 229cff71 authored by TravisCarden's avatar TravisCarden

By TravisCarden: Made a few very minor code improvements.

parent 1ef7a9c8
......@@ -142,7 +142,7 @@ class ChecklistapiChecklist {
public function saveProgress(array $values) {
global $user;
$time = time();
$changed_items_counter = 0;
$num_changed_items = 0;
$progress = array(
'#changed' => $time,
'#changed_by' => $user->uid,
......@@ -170,7 +170,7 @@ class ChecklistapiChecklist {
'#completed' => $time,
'#uid' => $user->uid,
);
$changed_items_counter++;
$num_changed_items++;
}
}
else {
......@@ -178,7 +178,7 @@ class ChecklistapiChecklist {
$new_item = 0;
if ($old_item) {
// Item was previously checked.
$changed_items_counter++;
$num_changed_items++;
}
}
$progress[$item_key] = $new_item;
......@@ -192,7 +192,7 @@ class ChecklistapiChecklist {
variable_set($this->getSavedProgressVariableName(), $progress);
drupal_set_message(format_plural(
$changed_items_counter,
$num_changed_items,
'Checklist %title has been updated. 1 item changed.',
'Checklist %title has been updated. @count items changed.',
array('%title' => $this->title)
......
......@@ -55,8 +55,7 @@ class ChecklistapiUnitTestCase extends DrupalUnitTestCase {
* Test checklistapi_strtolowercamel().
*/
public function testChecklistapiStrtolowercamel() {
$output = checklistapi_strtolowercamel('Abc def_ghi');
$this->assertEqual($output, 'abcDefGhi', 'Converted string to lowerCamel case.');
$this->assertEqual(checklistapi_strtolowercamel('Abc def_ghi'), 'abcDefGhi', 'Converted string to lowerCamel case.');
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment