Some of the older DB unit tests do not use the right whitespace format. This patch adds the necessary carriage returns.

CommentFileSizeAuthor
test_formatting.patch4.48 KBCrell

Comments

c960657’s picture

I'm not sure what exactly the right format is (it's not mentioned in the coding standards), but it looks like some more lines could use some wrapping.

502:    $id = db_insert('test_one_blob')->fields(array('blob1' => $data))->execute();
566:    $query = db_insert('test')->fields(array('name' => 'Bob'))->useDefaults(array('job'));
635:    $num_updated = db_update('test')->fields(array('job' => 'Musician'))->where('age > :age', array(':age' => 26))->execute();
802:    $id = db_insert('test_one_blob')->fields(array('blob1' => $data))->execute();
805:    db_update('test_one_blob')->condition('id', $id)->fields(array('blob1' => $data))->execute();
822:    db_update('test_two_blobs')->condition('id', $id)->fields(array('blob1' => 'and so', 'blob2' => 'is this'))->execute();
904:    db_merge('test_people')->key(array('job' => 'Speaker'))->fields(array('age' => 31, 'name' => 'Tiffany'))->execute();
921:    db_merge('test_people')->key(array('job' => 'Speaker'))->fields(array('age' => 31, 'name' => 'Tiffany'))->updateExcept('age')->execute();
938:    db_merge('test_people')->key(array('job' => 'Speaker'))->fields(array('age' => 31, 'name' => 'Tiffany'))->update(array('name' => 'Joe'))->execute();

The list was generated using this command:
egrep -n "\)->(fields|condition|execute|where)" modules/simpletest/tests/database_test.test | egrep ".{81}"

cburschka’s picture

Status: Needs review » Needs work

The syntax clean-up in the patch looks good, but since c960657 implies there is more to be done, the patch should probably be expanded.

davyvdb’s picture

Category: bug » task
Status: Needs work » Fixed

Looks as if this got already in somehow.

Status: Fixed » Closed (fixed)
Issue tags: -Quick fix, -dc2009 code sprint

Automatically closed -- issue fixed for 2 weeks with no activity.