summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2008-09-15 20:48:10 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2008-09-15 20:48:10 +0000
commit161a9970f77ce6813e710e08076f5d4fc494259a (patch)
tree3d349326150a59d58bbaf868148fd197e8ca903c /modules
parentcf987be12d600a513f5efa779602ad4b6682e147 (diff)
downloadbrdo-161a9970f77ce6813e710e08076f5d4fc494259a.tar.gz
brdo-161a9970f77ce6813e710e08076f5d4fc494259a.tar.bz2
#308534 by Dave Reid: Remove stray whitespace core-wide.
Diffstat (limited to 'modules')
-rw-r--r--modules/contact/contact.test4
-rw-r--r--modules/menu/menu.module4
-rw-r--r--modules/node/node.admin.inc6
-rw-r--r--modules/profile/profile.pages.inc2
-rw-r--r--modules/simpletest/simpletest.test2
-rw-r--r--modules/simpletest/tests/bootstrap.test4
-rw-r--r--modules/simpletest/tests/database_test.install66
-rw-r--r--modules/simpletest/tests/database_test.module11
-rw-r--r--modules/simpletest/tests/database_test.test217
-rw-r--r--modules/simpletest/tests/menu.test2
-rw-r--r--modules/statistics/statistics.module12
-rw-r--r--modules/system/system.test17
-rw-r--r--modules/taxonomy/taxonomy.pages.inc2
-rw-r--r--modules/taxonomy/taxonomy.test4
-rw-r--r--modules/user/user.test3
15 files changed, 176 insertions, 180 deletions
diff --git a/modules/contact/contact.test b/modules/contact/contact.test
index 2d756156d..1bea7e53c 100644
--- a/modules/contact/contact.test
+++ b/modules/contact/contact.test
@@ -60,7 +60,7 @@ class ContactSitewideTestCase extends DrupalWebTestCase {
$recipients = array('simpletest@example.com', 'simpletest2@example.com', 'simpletest3@example.com');
$this->addCategory($category = $this->randomName(16), implode(',', array($recipients[0])), '', TRUE);
$this->assertRaw(t('Category %category has been added.', array('%category' => $category)), t('Category successfully added.'));
-
+
// Test update contact form category
$categories = $this->getCategories();
$category_id = $this->updateCategory($categories, $category = $this->randomName(16), $recipients_str = implode(',', array($recipients[0], $recipients[1])), $reply = $this->randomName(30), FALSE);
@@ -70,7 +70,7 @@ class ContactSitewideTestCase extends DrupalWebTestCase {
$this->assertEqual($category_array['reply'], $reply);
$this->assertFalse($category_array['selected']);
$this->assertRaw(t('Category %category has been updated.', array('%category' => $category)), t('Category successfully updated.'));
-
+
$this->addCategory($category = $this->randomName(16), implode(',', array($recipients[0], $recipients[1])), '', FALSE);
$this->assertRaw(t('Category %category has been added.', array('%category' => $category)), t('Category successfully added.'));
diff --git a/modules/menu/menu.module b/modules/menu/menu.module
index 3996acbc2..03406735c 100644
--- a/modules/menu/menu.module
+++ b/modules/menu/menu.module
@@ -315,13 +315,13 @@ function menu_nodeapi(&$node, $op) {
if (isset($node->nid)) {
// Give priority to the default menu
$mlid = db_result(db_query_range("SELECT mlid FROM {menu_links} WHERE link_path = :path AND menu_name = :menu_name AND module = 'menu' ORDER BY mlid ASC", array(
- ':path' => 'node/'. $node->nid,
+ ':path' => 'node/'. $node->nid,
':menu_name' => $menu_name,
), 0, 1));
// Check all menus if a link does not exist in the default menu.
if (!$mlid) {
$mlid = db_result(db_query_range("SELECT mlid FROM {menu_links} WHERE link_path = :path AND module = 'menu' ORDER BY mlid ASC", array(
- ':path' => 'node/'. $node->nid,
+ ':path' => 'node/'. $node->nid,
), 0, 1));
}
if ($mlid) {
diff --git a/modules/node/node.admin.inc b/modules/node/node.admin.inc
index c69c7894b..9f28f5f6e 100644
--- a/modules/node/node.admin.inc
+++ b/modules/node/node.admin.inc
@@ -478,10 +478,10 @@ function node_admin_nodes() {
// Build the query and load the nodes we want to display.
$filter = node_build_filter_query();
-
+
$sort = tablesort_sql($header, '', 'n.changed DESC');
$result = pager_query(db_rewrite_sql('SELECT n.*, u.name FROM {node} n '. $filter['join'] .' INNER JOIN {users} u ON n.uid = u.uid '. $filter['where'] . $sort), 50, 0, NULL, $filter['args']);
-
+
// Build the 'Update options' form.
$form['options'] = array(
'#type' => 'fieldset',
@@ -608,7 +608,7 @@ function theme_node_admin_nodes($form) {
}
$output .= theme('table', $header, $rows);
-
+
if ($form['pager']['#markup']) {
$output .= drupal_render($form['pager']);
}
diff --git a/modules/profile/profile.pages.inc b/modules/profile/profile.pages.inc
index 56344503c..275a9d463 100644
--- a/modules/profile/profile.pages.inc
+++ b/modules/profile/profile.pages.inc
@@ -111,7 +111,7 @@ function profile_autocomplete($field, $string) {
$matches = array();
if (db_result(db_query("SELECT COUNT(*) FROM {profile_fields} WHERE fid = %d AND autocomplete = 1", $field))) {
$result = db_query_range("SELECT value FROM {profile_values} WHERE fid = :fid AND LOWER(value) LIKE LOWER(:value) GROUP BY value ORDER BY value ASC", array(
- ':fid' => $field,
+ ':fid' => $field,
':value' => $string .'%',
), 0, 10);
while ($data = db_fetch_object($result)) {
diff --git a/modules/simpletest/simpletest.test b/modules/simpletest/simpletest.test
index dbb91c2ef..e319d3334 100644
--- a/modules/simpletest/simpletest.test
+++ b/modules/simpletest/simpletest.test
@@ -113,7 +113,7 @@ class SimpleTestTestCase extends DrupalWebTestCase {
// Call an assert function specific to that class.
$this->assertNothing();
-
+
// Generates a warning inside a PHP function.
array_key_exists(NULL, NULL);
}
diff --git a/modules/simpletest/tests/bootstrap.test b/modules/simpletest/tests/bootstrap.test
index ea59fa7eb..8be13aaeb 100644
--- a/modules/simpletest/tests/bootstrap.test
+++ b/modules/simpletest/tests/bootstrap.test
@@ -110,7 +110,7 @@ class BootstrapPageCacheTestCase extends DrupalWebTestCase {
}
class BootstrapVariableTestCase extends DrupalWebTestCase {
-
+
/**
* Implementation of setUp().
*/
@@ -141,7 +141,7 @@ class BootstrapVariableTestCase extends DrupalWebTestCase {
// Make sure the variable persists across multiple requests.
$this->drupalGet('system-test/variable-get');
$this->assertText($variable, t('Variable persists across multiple requests'));
-
+
// Deleting variables.
$default_value = $this->randomName();
variable_del('simpletest_bootstrap_variable_test');
diff --git a/modules/simpletest/tests/database_test.install b/modules/simpletest/tests/database_test.install
index e2fcb1b77..bb012976c 100644
--- a/modules/simpletest/tests/database_test.install
+++ b/modules/simpletest/tests/database_test.install
@@ -3,7 +3,7 @@
/**
* Implementation of hook_schema().
- *
+ *
* The database tests use the database API which depends on schema
* information for certain operations on certain databases.
* Therefore, the schema must actually be declared in a normal module
@@ -14,28 +14,28 @@ function database_test_schema() {
'description' => 'Basic test table for the database unit tests.',
'fields' => array(
'id' => array(
- 'type' => 'serial',
- 'unsigned' => TRUE,
+ 'type' => 'serial',
+ 'unsigned' => TRUE,
'not null' => TRUE,
),
'name' => array(
'description' => "A person's name",
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => TRUE,
+ 'type' => 'varchar',
+ 'length' => 255,
+ 'not null' => TRUE,
'default' => '',
),
'age' => array(
'description' => "The person's age",
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
+ 'type' => 'int',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
'default' => 0),
'job' => array(
'description' => "The person's job",
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => TRUE,
+ 'type' => 'varchar',
+ 'length' => 255,
+ 'not null' => TRUE,
'default' => 'Undefined',
),
),
@@ -47,7 +47,7 @@ function database_test_schema() {
'ages' => array('age'),
),
);
-
+
// This is an alternate version of the same table that is structured the same
// but has a non-serial Primary Key.
$schema['test_people'] = array(
@@ -55,23 +55,23 @@ function database_test_schema() {
'fields' => array(
'name' => array(
'description' => "A person's name",
- 'type' => 'varchar',
- 'length' => 255,
+ 'type' => 'varchar',
+ 'length' => 255,
'not null' => TRUE,
'default' => '',
),
'age' => array(
'description' => "The person's age",
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
+ 'type' => 'int',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
'default' => 0,
),
'job' => array(
'description' => "The person's job",
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => TRUE,
+ 'type' => 'varchar',
+ 'length' => 255,
+ 'not null' => TRUE,
'default' => '',
),
),
@@ -86,7 +86,7 @@ function database_test_schema() {
'fields' => array(
'id' => array(
'description' => 'Simple unique ID.',
- 'type' => 'serial',
+ 'type' => 'serial',
'not null' => TRUE,
),
'blob1' => array(
@@ -102,7 +102,7 @@ function database_test_schema() {
'fields' => array(
'id' => array(
'description' => 'Simple unique ID.',
- 'type' => 'serial',
+ 'type' => 'serial',
'not null' => TRUE,
),
'blob1' => array(
@@ -122,28 +122,28 @@ function database_test_schema() {
'fields' => array(
'tid' => array(
'description' => 'Task ID, primary key.',
- 'type' => 'serial',
+ 'type' => 'serial',
'not null' => TRUE,
),
'pid' => array(
'description' => 'The {test_people}.pid, foreign key for the test table.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
+ 'type' => 'int',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
'default' => 0,
),
'task' => array(
'description' => 'The task to be completed.',
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => TRUE,
+ 'type' => 'varchar',
+ 'length' => 255,
+ 'not null' => TRUE,
'default' => '',
),
'priority' => array(
'description' => 'The priority of the task.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
+ 'type' => 'int',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
'default' => 0,
),
),
diff --git a/modules/simpletest/tests/database_test.module b/modules/simpletest/tests/database_test.module
index 0b6ad2ce2..48239fcbf 100644
--- a/modules/simpletest/tests/database_test.module
+++ b/modules/simpletest/tests/database_test.module
@@ -13,26 +13,25 @@ function database_test_query_alter(SelectQuery $query) {
if ($query->hasTag('database_test_alter_remove_range')) {
$query->range();
}
-
+
if ($query->hasTag('database_test_alter_add_join')) {
$people_alias = $query->join('test', 'people', "test_task.pid=people.id");
$name_field = $query->addField('people', 'name', 'name');
$query->condition($people_alias . '.id', 2);
}
-
+
if ($query->hasTag('database_test_alter_change_conditional')) {
$conditions =& $query->conditions();
$conditions[0]['value'] = 2;
}
-
+
if ($query->hasTag('database_test_alter_change_fields')) {
$fields =& $query->getFields();
unset($fields['age']);
}
-
+
if ($query->hasTag('database_test_alter_change_expressions')) {
$expressions =& $query->getExpressions();
$expressions['double_age']['expression'] = 'age*3';
- }
+ }
}
-
diff --git a/modules/simpletest/tests/database_test.test b/modules/simpletest/tests/database_test.test
index 5ce1f8db1..17b838b71 100644
--- a/modules/simpletest/tests/database_test.test
+++ b/modules/simpletest/tests/database_test.test
@@ -7,12 +7,12 @@
* PDO supports using a new instance of an arbitrary class for records
* rather than just a stdClass or array. This class is for testing that
* functionality. (See testQueryFetchClass() below)
- */
+ */
class FakeRecord { }
/**
* Base test class for databases.
- *
+ *
* Because all database tests share the same test data, we can centralize that
* here.
*/
@@ -27,10 +27,10 @@ class DatabaseTestCase extends DrupalWebTestCase {
$schema['test_one_blob'] = drupal_get_schema('test_one_blob');
$schema['test_two_blobs'] = drupal_get_schema('test_two_blobs');
$schema['test_task'] = drupal_get_schema('test_task');
-
+
$ret = array();
-
- // This ends up being a test for table drop and create, too, which is
+
+ // This ends up being a test for table drop and create, too, which is
// nice.
foreach ($schema as $name => $data) {
if (db_table_exists($name)) {
@@ -38,11 +38,11 @@ class DatabaseTestCase extends DrupalWebTestCase {
}
db_create_table($ret, $name, $data);
}
-
+
foreach ($schema as $name => $data) {
$this->assertTrue(db_table_exists($name), t('Table @name created successfully.', array('@name' => $name)));
}
-
+
$this->addSampleData();
}
catch (Exception $e) {
@@ -53,7 +53,7 @@ class DatabaseTestCase extends DrupalWebTestCase {
/**
* Setup our sample data.
*
- * These are added using db_query(), since we're not trying to test the
+ * These are added using db_query(), since we're not trying to test the
* INSERT operations here, just populate.
*/
function addSampleData() {
@@ -69,38 +69,38 @@ class DatabaseTestCase extends DrupalWebTestCase {
db_query("INSERT INTO {test_people} (name, age, job) VALUES ('Meredith', 30, 'Speaker')");
db_query("INSERT INTO {test_task} (pid, task, priority) VALUES (:pid, :task, :priority)", array(
- ':pid' => $john,
- ':task' => 'eat',
+ ':pid' => $john,
+ ':task' => 'eat',
':priority' => 3,
));
db_query("INSERT INTO {test_task} (pid, task, priority) VALUES (:pid, :task, :priority)", array(
- ':pid' => $john,
- ':task' => 'sleep',
+ ':pid' => $john,
+ ':task' => 'sleep',
':priority' => 4,
));
db_query("INSERT INTO {test_task} (pid, task, priority) VALUES (:pid, :task, :priority)", array(
- ':pid' => $john,
- ':task' => 'code',
+ ':pid' => $john,
+ ':task' => 'code',
':priority' => 1,
));
db_query("INSERT INTO {test_task} (pid, task, priority) VALUES (:pid, :task, :priority)", array(
- ':pid' => $george,
- ':task' => 'sing',
+ ':pid' => $george,
+ ':task' => 'sing',
':priority' => 2,
));
db_query("INSERT INTO {test_task} (pid, task, priority) VALUES (:pid, :task, :priority)", array(
- ':pid' => $george,
- ':task' => 'sleep',
+ ':pid' => $george,
+ ':task' => 'sleep',
':priority' => 2,
));
db_query("INSERT INTO {test_task} (pid, task, priority) VALUES (:pid, :task, :priority)", array(
- ':pid' => $paul,
- ':task' => 'found new band',
+ ':pid' => $paul,
+ ':task' => 'found new band',
':priority' => 1,
));
db_query("INSERT INTO {test_task} (pid, task, priority) VALUES (:pid, :task, :priority)", array(
- ':pid' => $paul,
- ':task' => 'perform at superbowl',
+ ':pid' => $paul,
+ ':task' => 'perform at superbowl',
':priority' => 3,
));
}
@@ -109,11 +109,11 @@ class DatabaseTestCase extends DrupalWebTestCase {
/**
* Test fetch actions, part 1.
- *
+ *
* We get timeout errors if we try to run too many tests at once.
*/
class DatabaseFetchTestCase extends DatabaseTestCase {
-
+
function getInfo() {
return array(
'name' => t('Fetch tests'),
@@ -191,7 +191,7 @@ class DatabaseFetchTestCase extends DatabaseTestCase {
/**
* Test fetch actions, part 2.
- *
+ *
* We get timeout errors if we try to run too many tests at once.
*/
class DatabaseFetch2TestCase extends DatabaseTestCase {
@@ -241,7 +241,7 @@ class DatabaseFetch2TestCase extends DatabaseTestCase {
/**
* Confirm that we can fetch an entire column of a result set at once.
- */
+ */
function testQueryFetchCol() {
$records = array();
$result = db_query("SELECT name FROM {test} WHERE age > :age", array(':age' => 25));
@@ -276,7 +276,7 @@ class DatabaseInsertTestCase extends DatabaseTestCase {
function testSimpleInsert() {
try {
$num_records_before = db_query("SELECT COUNT(*) FROM {test}")->fetchField();
-
+
$query = db_insert('test');
$query->fields(array(
'name' => 'Yoko',
@@ -286,7 +286,7 @@ class DatabaseInsertTestCase extends DatabaseTestCase {
$num_records_after = db_query("SELECT COUNT(*) FROM {test}")->fetchField();
$this->assertIdentical($num_records_before + 1, (int)$num_records_after, t('Record inserts correctly.'));
-
+
$saved_age = db_query("SELECT age FROM {test} WHERE name = :name", array(':name' => 'Yoko'))->fetchField();
$this->assertIdentical($saved_age, '29', t('Can retrieve after inserting.'));
}
@@ -301,24 +301,24 @@ class DatabaseInsertTestCase extends DatabaseTestCase {
function testMultiInsert() {
try {
$num_records_before = (int) db_query("SELECT COUNT(*) FROM {test}")->fetchField();
-
+
$query = db_insert('test');
$query->fields(array(
'name' => 'Larry',
'age' => '30',
));
-
+
// We should be able to specify values in any order if named.
$query->values(array(
'age' => '31',
'name' => 'Curly',
));
-
+
// We should be able to say "use the field order".
// This is not the recommended mechanism for most cases, but it should work.
$query->values(array('Moe', '32'));
$query->execute();
-
+
$num_records_after = (int) db_query("SELECT COUNT(*) FROM {test}")->fetchField();
$this->assertIdentical($num_records_before + 3, $num_records_after, t('Record inserts correctly.'));
$saved_age = db_query("SELECT age FROM {test} WHERE name = :name", array(':name' => 'Larry'))->fetchField();
@@ -339,26 +339,26 @@ class DatabaseInsertTestCase extends DatabaseTestCase {
function testRepeatedInsert() {
try {
$num_records_before = db_query("SELECT COUNT(*) FROM {test}")->fetchField();
-
+
$query = db_insert('test');
-
+
$query->fields(array(
'name' => 'Larry',
'age' => '30',
));
$query->execute(); // This should run the insert, but leave the fields intact.
-
+
// We should be able to specify values in any order if named.
$query->values(array(
'age' => '31',
'name' => 'Curly',
));
$query->execute();
-
+
// We should be able to say "use the field order".
$query->values(array('Moe', '32'));
$query->execute();
-
+
$num_records_after = db_query("SELECT COUNT(*) FROM {test}")->fetchField();
$this->assertIdentical((int) $num_records_before + 3, (int) $num_records_after, t('Record inserts correctly.'));
$saved_age = db_query("SELECT age FROM {test} WHERE name = :name", array(':name' => 'Larry'))->fetchField();
@@ -399,7 +399,7 @@ class DatabaseInsertTestCase extends DatabaseTestCase {
'age' => '30',
))
->execute();
-
+
$this->assertIdentical($id, '5', t('Auto-increment ID returned successfully.'));
}
catch (Exception $e) {
@@ -438,7 +438,7 @@ class DatabaseInsertLOBTestCase extends DatabaseTestCase {
*/
function testInsertMultipleBlob() {
$id = db_insert('test_two_blobs')->fields(array(
- 'blob1' => 'This is',
+ 'blob1' => 'This is',
'blob2' => 'a test',
))
->execute();
@@ -460,7 +460,7 @@ class DatabaseInsertDefaultsTestCase extends DatabaseTestCase {
'group' => t('Database'),
);
}
-
+
/**
* Test that we can run a query that is "default values for everything".
*/
@@ -468,9 +468,9 @@ class DatabaseInsertDefaultsTestCase extends DatabaseTestCase {
try {
$query = db_insert('test')->useDefaults(array('job'));
$id = $query->execute();
-
+
$schema = drupal_get_schema('test');
-
+
$job = db_query("SELECT job FROM {test} WHERE id = :id", array(':id' => $id))->fetchField();
$this->assertEqual($job, $schema['fields']['job']['default'], t('Default field value is set.'));
}
@@ -486,9 +486,9 @@ class DatabaseInsertDefaultsTestCase extends DatabaseTestCase {
try {
$query = db_insert('test')->fields(array('name' => 'Bob'))->useDefaults(array('job'));
$id = $query->execute();
-
+
$schema = drupal_get_schema('test');
-
+
$job = db_query("SELECT job FROM {test} WHERE id = :id", array(':id' => $id))->fetchField();
$this->assertEqual($job, $schema['fields']['job']['default'], t('Default field value is set.'));
}
@@ -521,7 +521,7 @@ class DatabaseUpdateTestCase extends DatabaseTestCase {
$saved_name = db_query("SELECT name FROM {test} WHERE id = :id", array(':id' => 1))->fetchField();
$this->assertIdentical($saved_name, 'Tiffany', t('Updated name successfully.'));
}
-
+
/**
* Confirm that we can update a multiple records successfully.
*/
@@ -633,7 +633,7 @@ class DatabaseUpdateComplexTestCase extends DatabaseTestCase {
->condition('age', array(25, 26), 'BETWEEN')
->execute();
$this->assertIdentical($num_updated, 2, t('Updated 2 records.'));
-
+
$num_matches = db_query("SELECT count(*) FROM {test} WHERE job = :job", array(':job' => 'Musician'))->fetchField();
$this->assertIdentical($num_matches, '2', t('Updated fields successfully.'));
}
@@ -668,10 +668,10 @@ class DatabaseUpdateComplexTestCase extends DatabaseTestCase {
->expression('age', 'age + :age',array(':age' => 4))
->execute();
$this->assertIdentical($num_updated, 1, t('Updated 1 record.'));
-
+
$num_matches = db_query("SELECT count(*) FROM {test} WHERE job = :job", array(':job' => 'Musician'))->fetchField();
$this->assertIdentical($num_matches, '1', t('Updated fields successfully.'));
-
+
$person = db_query("SELECT * FROM {test} WHERE name = :name", array(':name' => 'Ringo'))->fetch();
$this->assertEqual($person->name, 'Ringo', t('Name set correctly.'));
$this->assertEqual($person->age, $before_age + 4, t('Age set correctly.'));
@@ -712,13 +712,13 @@ class DatabaseUpdateLOBTestCase extends DatabaseTestCase {
$r = db_fetch_array($res);
$this->assertTrue($r['blob1'] === $data, t('Can update a blob: id @id, @data.', array('@id' => $id, '@data' => serialize($r))));
}
-
+
/**
* Confirm that we can update two blob columns in the same table.
*/
function testUpdateMultipleBlob() {
$id = db_insert('test_two_blobs')->fields(array(
- 'blob1' => 'This is',
+ 'blob1' => 'This is',
'blob2' => 'a test')
)
->execute();
@@ -782,18 +782,18 @@ class DatabaseMergeTestCase extends DatabaseTestCase {
function testMergeInsert() {
try{
$num_records_before = db_query("SELECT COUNT(*) FROM {test_people}")->fetchField();
-
+
db_merge('test_people')
->key(array('job' => 'Presenter'))
->fields(array(
- 'age' => 31,
+ 'age' => 31,
'name' => 'Tiffany',
))
->execute();
$num_records_after = db_query("SELECT COUNT(*) FROM {test_people}")->fetchField();
$this->assertEqual($num_records_before + 1, $num_records_after, t('Merge inserted properly.'));
-
+
$person = db_query("SELECT * FROM {test_people} WHERE job = :job", array(':job' => 'Presenter'))->fetch();
$this->assertEqual($person->name, 'Tiffany', t('Name set correctly.'));
$this->assertEqual($person->age, 31, t('Age set correctly.'));
@@ -814,7 +814,7 @@ class DatabaseMergeTestCase extends DatabaseTestCase {
$num_records_after = db_query("SELECT COUNT(*) FROM {test_people}")->fetchField();
$this->assertEqual($num_records_before, $num_records_after, t('Merge updated properly.'));
-
+
$person = db_query("SELECT * FROM {test_people} WHERE job = :job", array(':job' => 'Speaker'))->fetch();
$this->assertEqual($person->name, 'Tiffany', t('Name set correctly.'));
$this->assertEqual($person->age, 31, t('Age set correctly.'));
@@ -831,7 +831,7 @@ class DatabaseMergeTestCase extends DatabaseTestCase {
$num_records_after = db_query("SELECT COUNT(*) FROM {test_people}")->fetchField();
$this->assertEqual($num_records_before, $num_records_after, t('Merge updated properly.'));
-
+
$person = db_query("SELECT * FROM {test_people} WHERE job = :job", array(':job' => 'Speaker'))->fetch();
$this->assertEqual($person->name, 'Tiffany', t('Name set correctly.'));
$this->assertEqual($person->age, 30, t('Age skipped correctly.'));
@@ -848,7 +848,7 @@ class DatabaseMergeTestCase extends DatabaseTestCase {
$num_records_after = db_query("SELECT COUNT(*) FROM {test_people}")->fetchField();
$this->assertEqual($num_records_before, $num_records_after, t('Merge updated properly.'));
-
+
$person = db_query("SELECT * FROM {test_people} WHERE job = :job", array(':job' => 'Speaker'))->fetch();
$this->assertEqual($person->name, 'Joe', t('Name set correctly.'));
$this->assertEqual($person->age, 30, t('Age skipped correctly.'));
@@ -863,7 +863,7 @@ class DatabaseMergeTestCase extends DatabaseTestCase {
$age_before = db_query("SELECT age FROM {test_people} WHERE job = 'Speaker'")->fetchField();
- // This is a very contrived example, as I have no idea why you'd want to
+ // This is a very contrived example, as I have no idea why you'd want to
// change age this way, but that's beside the point.
// Note that we are also double-setting age here, once as a literal and
// once as an expression. This test will only pass if the expression wins,
@@ -876,7 +876,7 @@ class DatabaseMergeTestCase extends DatabaseTestCase {
$num_records_after = db_query("SELECT COUNT(*) FROM {test_people}")->fetchField();
$this->assertEqual($num_records_before, $num_records_after, t('Merge updated properly.'));
-
+
$person = db_query("SELECT * FROM {test_people} WHERE job = :job", array(':job' => 'Speaker'))->fetch();
$this->assertEqual($person->name, 'Tiffany', t('Name set correctly.'));
$this->assertEqual($person->age, $age_before + 4, t('Age updated correctly.'));
@@ -907,12 +907,12 @@ class DatabaseSelectTestCase extends DatabaseTestCase {
$name_field = $query->addField('test', 'name');
$age_field = $query->addField('test', 'age', 'age');
$result = $query->execute();
-
+
$num_records = 0;
foreach ($result as $record) {
$num_records++;
}
-
+
$this->assertEqual($num_records, 4, t('Returned the correct number of rows.'));
}
catch(Exception $e) {
@@ -929,11 +929,11 @@ class DatabaseSelectTestCase extends DatabaseTestCase {
$age_field = $query->addField('test', 'age', 'age');
$query->condition('age', 27);
$result = $query->execute();
-
+
// Check that the aliases are being created the way we want.
$this->assertEqual($name_field, 'test_name', t('Name field alias is correct.'));
$this->assertEqual($age_field, 'age', t('Age field alias is correct.'));
-
+
// Ensure that we got the right record.
$record = $result->fetch();
$this->assertEqual($record->$name_field, 'George', t('Fetched name is correct.'));
@@ -949,11 +949,11 @@ class DatabaseSelectTestCase extends DatabaseTestCase {
$age_field = $query->addExpression("age*2", 'double_age');
$query->condition('age', 27);
$result = $query->execute();
-
+
// Check that the aliases are being created the way we want.
$this->assertEqual($name_field, 'test_name', t('Name field alias is correct.'));
$this->assertEqual($age_field, 'double_age', t('Age field alias is correct.'));
-
+
// Ensure that we got the right record.
$record = $result->fetch();
$this->assertEqual($record->$name_field, 'George', t('Fetched name is correct.'));
@@ -984,7 +984,7 @@ class DatabaseSelectOrderedTestCase extends DatabaseTestCase {
$age_field = $query->addField('test', 'age', 'age');
$query->orderBy($age_field);
$result = $query->execute();
-
+
$num_records = 0;
$last_age = 0;
foreach ($result as $record) {
@@ -992,7 +992,7 @@ class DatabaseSelectOrderedTestCase extends DatabaseTestCase {
$this->assertTrue($record->age >= $last_age, t('Results returned in correct order.'));
$last_age = $record->age;
}
-
+
$this->assertEqual($num_records, 4, t('Returned the correct number of rows.'));
}
catch(Exception $e) {
@@ -1012,7 +1012,7 @@ class DatabaseSelectOrderedTestCase extends DatabaseTestCase {
$query->orderBy($job_field);
$query->orderBy($age_field);
$result = $query->execute();
-
+
$num_records = 0;
$expected = array(
array('Ringo', 28, 'Drummer'),
@@ -1047,7 +1047,7 @@ class DatabaseSelectOrderedTestCase extends DatabaseTestCase {
$age_field = $query->addField('test', 'age', 'age');
$query->orderBy($age_field, 'DESC');
$result = $query->execute();
-
+
$num_records = 0;
$last_age = 100000000;
foreach ($result as $record) {
@@ -1055,7 +1055,7 @@ class DatabaseSelectOrderedTestCase extends DatabaseTestCase {
$this->assertTrue($record->age <= $last_age, t('Results returned in correct order.'));
$last_age = $record->age;
}
-
+
$this->assertEqual($num_records, 4, t('Returned the correct number of rows.'));
}
catch(Exception $e) {
@@ -1087,10 +1087,10 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
$name_field = $query->addField($people_alias, 'name', 'name');
$task_field = $query->addField('t', 'task', 'task');
$priority_field = $query->addField('t', 'priority', 'priority');
-
+
$query->orderBy($priority_field);
$result = $query->execute();
-
+
$num_records = 0;
$last_priority = 0;
foreach ($result as $record) {
@@ -1099,7 +1099,7 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
$this->assertNotEqual($record->$name_field, 'Ringo', t('Taskless person not selected.'));
$last_priority = $record->$priority_field;
}
-
+
$this->assertEqual($num_records, 7, t('Returned the correct number of rows.'));
}
catch(Exception $e) {
@@ -1117,19 +1117,19 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
$name_field = $query->addField('p', 'name', 'name');
$task_field = $query->addField($people_alias, 'task', 'task');
$priority_field = $query->addField($people_alias, 'priority', 'priority');
-
+
$query->orderBy($name_field);
$result = $query->execute();
-
+
$num_records = 0;
$last_name = 0;
-
+
foreach ($result as $record) {
$num_records++;
$this->assertTrue(strcmp($record->$name_field, $last_name) >= 0, t('Results returned in correct order.'));
$last_priority = $record->$name_field;
}
-
+
$this->assertEqual($num_records, 8, t('Returned the correct number of rows.'));
}
catch(Exception $e) {
@@ -1148,7 +1148,7 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
$query->orderBy($count_field);
$query->groupBy($task_field);
$result = $query->execute();
-
+
$num_records = 0;
$last_count = 0;
$records = array();
@@ -1158,7 +1158,7 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
$last_count = $record->$count_field;
$records[$record->$task_field] = $record->$count_field;
}
-
+
$correct_results = array(
'eat' => 1,
'sleep' => 2,
@@ -1166,7 +1166,7 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
'found new band' => 1,
'perform at superbowl' => 1,
);
-
+
foreach ($correct_results as $task => $count) {
$this->assertEqual($records[$task], $count, t("Correct number of '@task' records found.", array('@task' => $task)));
}
@@ -1190,7 +1190,7 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
$query->groupBy($task_field);
$query->havingCondition('COUNT(task)', 2, '>=');
$result = $query->execute();
-
+
$num_records = 0;
$last_count = 0;
$records = array();
@@ -1201,11 +1201,11 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
$last_count = $record->$count_field;
$records[$record->$task_field] = $record->$count_field;
}
-
+
$correct_results = array(
'sleep' => 2,
);
-
+
foreach ($correct_results as $task => $count) {
$this->assertEqual($records[$task], $count, t("Correct number of '@task' records found.", array('@task' => $task)));
}
@@ -1227,12 +1227,12 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
$age_field = $query->addField('test', 'age', 'age');
$query->range(0, 2);
$result = $query->execute();
-
+
$num_records = 0;
foreach ($result as $record) {
$num_records++;
}
-
+
$this->assertEqual($num_records, 2, t('Returned the correct number of rows.'));
}
catch(Exception $e) {
@@ -1249,12 +1249,12 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
$task_field = $query->addField('test_task', 'task');
$query->distinct();
$result = $query->execute();
-
+
$num_records = 0;
foreach ($result as $record) {
$num_records++;
}
-
+
$this->assertEqual($num_records, 6, t('Returned the correct number of rows.'));
}
catch(Exception $e) {
@@ -1271,11 +1271,11 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
$name_field = $query->addField('test', 'name');
$age_field = $query->addField('test', 'age', 'age');
$query->orderBy('name');
-
+
$count = $query->countQuery()->execute()->fetchField();
-
+
$this->assertEqual($count, 4, t('Counted the correct number of records.'));
-
+
// Now make sure we didn't break the original query! We should still have
// all of the fields we asked for.
$record = $query->execute()->fetch();
@@ -1290,7 +1290,7 @@ class DatabaseSelectComplexTestCase extends DatabaseTestCase {
/**
* Select tagging tests.
- *
+ *
* Tags are a way to flag queries for alter hooks so they know
* what type of query it is, such as "node_access".
*/
@@ -1312,9 +1312,9 @@ class DatabaseTaggingTestCase extends DatabaseTestCase {
$query = db_select('test');
$query->addField('test', 'name');
$query->addField('test', 'age', 'age');
-
+
$query->addTag('test');
-
+
$this->assertTrue($query->hasTag('test'), t('hasTag() returned true.'));
$this->assertFalse($query->hasTag('other'), t('hasTag() returned false.'));
}
@@ -1331,10 +1331,10 @@ class DatabaseTaggingTestCase extends DatabaseTestCase {
$query = db_select('test');
$query->addField('test', 'name');
$query->addField('test', 'age', 'age');
-
+
$query->addTag('test');
$query->addTag('other');
-
+
$this->assertTrue($query->hasAllTags('test', 'other'), t('hasAllTags() returned true.'));
$this->assertFalse($query->hasAllTags('test', 'stuff'), t('hasAllTags() returned false.'));
}
@@ -1351,9 +1351,9 @@ class DatabaseTaggingTestCase extends DatabaseTestCase {
$query = db_select('test');
$query->addField('test', 'name');
$query->addField('test', 'age', 'age');
-
+
$query->addTag('test');
-
+
$this->assertTrue($query->hasAnyTag('test', 'other'), t('hasAnyTag() returned true.'));
$this->assertFalse($query->hasAnyTag('other', 'stuff'), t('hasAnyTag() returned false.'));
}
@@ -1364,7 +1364,7 @@ class DatabaseTaggingTestCase extends DatabaseTestCase {
/**
* Test that we can attach meta data to a query object.
- *
+ *
* This is how we pass additional context to alter hooks.
*/
function testMetaData() {
@@ -1372,17 +1372,17 @@ class DatabaseTaggingTestCase extends DatabaseTestCase {
$query = db_select('test');
$query->addField('test', 'name');
$query->addField('test', 'age', 'age');
-
+
$data = array(
'a' => 'A',
'b' => 'B',
);
-
+
$query->addMetaData('test', $data);
-
+
$return = $query->getMetaData('test');
$this->assertEqual($data, $return, t('Corect metadata returned.'));
-
+
$return = $query->getMetaData('nothere');
$this->assertNull($return, t('Non-existant key returned NULL.'));
}
@@ -1394,7 +1394,7 @@ class DatabaseTaggingTestCase extends DatabaseTestCase {
/**
* Select alter tests.
- *
+ *
* @see database_test_query_alter().
*/
class DatabaseAlterTestCase extends DatabaseTestCase {
@@ -1423,7 +1423,7 @@ class DatabaseAlterTestCase extends DatabaseTestCase {
foreach ($result as $record) {
$num_records++;
}
-
+
$this->assertEqual($num_records, 2, t('Returned the correct number of rows.'));
}
catch(Exception $e) {
@@ -1445,9 +1445,9 @@ class DatabaseAlterTestCase extends DatabaseTestCase {
$result = $query->execute();
$records = $result->fetchAll();
-
+
$this->assertEqual(count($records), 2, t('Returned the correct number of rows.'));
-
+
$this->assertEqual($records[0]->name, 'George', t('Correct data retrieved.'));
$this->assertEqual($records[0]->$tid_field, 4, t('Correct data retrieved.'));
$this->assertEqual($records[0]->$task_field, 'sing', t('Correct data retrieved.'));
@@ -1493,7 +1493,7 @@ class DatabaseAlterTestCase extends DatabaseTestCase {
/**
* Select alter tests, part 2.
- *
+ *
* @see database_test_query_alter().
*/
class DatabaseAlter2TestCase extends DatabaseTestCase {
@@ -1516,7 +1516,7 @@ class DatabaseAlter2TestCase extends DatabaseTestCase {
$age_field = $query->addField('test', 'age', 'age');
$query->orderBy('name');
$query->addTag('database_test_alter_change_fields');
-
+
$record = $query->execute()->fetch();
$this->assertEqual($record->$name_field, 'George', t('Correct data retrieved.'));
$this->assertFalse(isset($record->$age_field), t('Age field not found, as intended.'));
@@ -1537,7 +1537,7 @@ class DatabaseAlter2TestCase extends DatabaseTestCase {
$query->condition('age', 27);
$query->addTag('database_test_alter_change_expressions');
$result = $query->execute();
-
+
// Ensure that we got the right record.
$record = $result->fetch();
@@ -1569,4 +1569,3 @@ class DatabaseAlter2TestCase extends DatabaseTestCase {
}
}
}
-
diff --git a/modules/simpletest/tests/menu.test b/modules/simpletest/tests/menu.test
index 93e4a4a53..ca674248f 100644
--- a/modules/simpletest/tests/menu.test
+++ b/modules/simpletest/tests/menu.test
@@ -25,7 +25,7 @@ class MenuIncTestCase extends DrupalWebTestCase {
// Enable dummy module that implements hook_menu.
parent::setUp('hook_menu');
}
-
+
/**
* Tests for menu_name parameter for hook_menu().
*/
diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module
index 32504dfde..e96c09808 100644
--- a/modules/statistics/statistics.module
+++ b/modules/statistics/statistics.module
@@ -68,12 +68,12 @@ function statistics_exit() {
// Log this page access.
db_insert('accesslog')->fields(array(
'title' => strip_tags(drupal_get_title()),
- 'path' => $_GET['q'],
- 'url' => $_SERVER['HTTP_REFERER'],
- 'hostname' => ip_address(),
- 'uid' => $user->uid,
- 'sid' => session_id(),
- 'timer' => timer_read('page'),
+ 'path' => $_GET['q'],
+ 'url' => $_SERVER['HTTP_REFERER'],
+ 'hostname' => ip_address(),
+ 'uid' => $user->uid,
+ 'sid' => session_id(),
+ 'timer' => timer_read('page'),
'timestamp' => $_SERVER['REQUEST_TIME'],
))->execute();
}
diff --git a/modules/system/system.test b/modules/system/system.test
index 5af5df5d7..29b4e73eb 100644
--- a/modules/system/system.test
+++ b/modules/system/system.test
@@ -323,7 +323,7 @@ class AdminMetaTagTestCase extends DrupalWebTestCase {
class PageNotFoundTestCase extends DrupalWebTestCase {
protected $admin_user;
-
+
/**
* Implementation of getInfo().
*/
@@ -334,7 +334,7 @@ class PageNotFoundTestCase extends DrupalWebTestCase {
'group' => t('System')
);
}
-
+
/**
* Implementation of setUp().
*/
@@ -349,7 +349,7 @@ class PageNotFoundTestCase extends DrupalWebTestCase {
function testPageNotFound() {
$this->drupalGet($this->randomName(10));
$this->assertText(t('Page not found'), t('Found the default 404 page'));
-
+
$edit = array(
'title' => $this->randomName(10),
'body' => $this->randomName(100)
@@ -358,27 +358,26 @@ class PageNotFoundTestCase extends DrupalWebTestCase {
// Use a custom 404 page.
$this->drupalPost('admin/settings/error-reporting', array('site_404' => 'node/' . $node->nid), t('Save configuration'));
-
+
$this->drupalGet($this->randomName(10));
$this->assertText($node->title, t('Found the custom 404 page'));
-
+
// Logout and check that the user login block is not shown on custom 404 pages.
$this->drupalLogout();
-
+
$this->drupalGet($this->randomName(10));
$this->assertText($node->title, t('Found the custom 404 page'));
$this->assertNoText(t('User login'), t('Blocks are not shown on the custom 404 page'));
-
+
// Log back in and remove the custom 404 page.
$this->drupalLogin($this->admin_user);
$this->drupalPost('admin/settings/error-reporting', array(), t('Reset to defaults'));
// Logout and check that the user login block is not shown on default 404 pages.
$this->drupalLogout();
-
+
$this->drupalGet($this->randomName(10));
$this->assertText(t('Page not found'), t('Found the default 404 page'));
$this->assertNoText(t('User login'), t('Blocks are not shown on the default 404 page'));
}
}
-
diff --git a/modules/taxonomy/taxonomy.pages.inc b/modules/taxonomy/taxonomy.pages.inc
index 3ee0b9743..bcaffbf25 100644
--- a/modules/taxonomy/taxonomy.pages.inc
+++ b/modules/taxonomy/taxonomy.pages.inc
@@ -120,7 +120,7 @@ function taxonomy_autocomplete($vid, $string = '') {
$matches = array();
if ($last_string != '') {
$result = db_query_range(db_rewrite_sql("SELECT t.tid, t.name FROM {term_data} t WHERE t.vid = :vid AND LOWER(t.name) LIKE LOWER(:last_string)", 't', 'tid'), array(
- ':vid' => $vid,
+ ':vid' => $vid,
':last_string' => '%'. $last_string .'%',
), 0, 10);
diff --git a/modules/taxonomy/taxonomy.test b/modules/taxonomy/taxonomy.test
index be8e37815..6d8b25552 100644
--- a/modules/taxonomy/taxonomy.test
+++ b/modules/taxonomy/taxonomy.test
@@ -474,7 +474,7 @@ class TermEditTestCase extends DrupalWebTestCase {
and that term name and description are saved.'),
'group' => t('Taxonomy'));
}
-
+
/**
* Implementation of setUp().
*/
@@ -525,4 +525,4 @@ class TermEditTestCase extends DrupalWebTestCase {
$this->assertText($edit['name'], t('The randomly generated term name is present.'));
$this->assertText($edit['description'], t('The randomly generated term description is present.'));
}
-} \ No newline at end of file
+}
diff --git a/modules/user/user.test b/modules/user/user.test
index 57a6a570b..5359a1564 100644
--- a/modules/user/user.test
+++ b/modules/user/user.test
@@ -494,7 +494,7 @@ class UserAdminTestCase extends DrupalWebTestCase {
$this->assertText($user_c->name, t('Found user C on admin users page'));
$this->assertText($admin_user->name, t('Found Admin user on admin users page'));
- // Filter the users by permission 'administer taxonomy'.
+ // Filter the users by permission 'administer taxonomy'.
$edit = array();
$edit['filter'] = 'permission';
$edit['permission'] = 'administer taxonomy';
@@ -516,4 +516,3 @@ class UserAdminTestCase extends DrupalWebTestCase {
$this->assertEqual($account->status, 0, 'User B blocked');
}
}
-