summaryrefslogtreecommitdiff
path: root/modules/simpletest
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-05-06 05:59:31 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-05-06 05:59:31 +0000
commited86172814c02747b7036745f0411e34998c6f4a (patch)
tree6246e7451a458ec832aefa9404675709e78e982a /modules/simpletest
parent526558401680f5d8b402823dbd5d40fd17620980 (diff)
downloadbrdo-ed86172814c02747b7036745f0411e34998c6f4a.tar.gz
brdo-ed86172814c02747b7036745f0411e34998c6f4a.tar.bz2
#331951 by aspilicious, sun, jhodgdon, Morbus, et al: Figure out and apply coding standard for casting.
Diffstat (limited to 'modules/simpletest')
-rw-r--r--modules/simpletest/drupal_web_test_case.php14
-rw-r--r--modules/simpletest/tests/ajax_forms_test.module4
-rw-r--r--modules/simpletest/tests/batch.test2
-rw-r--r--modules/simpletest/tests/database_test.test2
-rw-r--r--modules/simpletest/tests/system_test.module2
-rw-r--r--modules/simpletest/tests/xmlrpc.test2
6 files changed, 13 insertions, 13 deletions
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php
index d7d95869b..16e661f15 100644
--- a/modules/simpletest/drupal_web_test_case.php
+++ b/modules/simpletest/drupal_web_test_case.php
@@ -837,7 +837,7 @@ class DrupalWebTestCase extends DrupalTestCase {
'locked' => 0,
);
$type = $forced + $settings + $defaults;
- $type = (object)$type;
+ $type = (object) $type;
$saved_type = node_type_save($type);
node_types_rebuild();
@@ -1866,8 +1866,8 @@ class DrupalWebTestCase extends DrupalTestCase {
$name = (string) $element['name'];
// This can either be the type of <input> or the name of the tag itself
// for <select> or <textarea>.
- $type = isset($element['type']) ? (string)$element['type'] : $element->getName();
- $value = isset($element['value']) ? (string)$element['value'] : '';
+ $type = isset($element['type']) ? (string) $element['type'] : $element->getName();
+ $value = isset($element['value']) ? (string) $element['value'] : '';
$done = FALSE;
if (isset($edit[$name])) {
switch ($type) {
@@ -1906,7 +1906,7 @@ class DrupalWebTestCase extends DrupalTestCase {
$index = 0;
$key = preg_replace('/\[\]$/', '', $name);
foreach ($options as $option) {
- $option_value = (string)$option['value'];
+ $option_value = (string) $option['value'];
if (in_array($option_value, $new_value)) {
$post[$key . '[' . $index++ . ']'] = $option_value;
$done = TRUE;
@@ -1942,7 +1942,7 @@ class DrupalWebTestCase extends DrupalTestCase {
if (!isset($post[$name]) && !$done) {
switch ($type) {
case 'textarea':
- $post[$name] = (string)$element;
+ $post[$name] = (string) $element;
break;
case 'select':
$single = empty($element['multiple']);
@@ -1956,10 +1956,10 @@ class DrupalWebTestCase extends DrupalTestCase {
if ($option['selected'] || ($first && $single)) {
$first = FALSE;
if ($single) {
- $post[$name] = (string)$option['value'];
+ $post[$name] = (string) $option['value'];
}
else {
- $post[$key . '[' . $index++ . ']'] = (string)$option['value'];
+ $post[$key . '[' . $index++ . ']'] = (string) $option['value'];
}
}
}
diff --git a/modules/simpletest/tests/ajax_forms_test.module b/modules/simpletest/tests/ajax_forms_test.module
index db8aa3b92..fa23acda8 100644
--- a/modules/simpletest/tests/ajax_forms_test.module
+++ b/modules/simpletest/tests/ajax_forms_test.module
@@ -81,8 +81,8 @@ function ajax_forms_test_simple_form_select_callback($form, $form_state) {
*/
function ajax_forms_test_simple_form_checkbox_callback($form, $form_state) {
$commands = array();
- $commands[] = ajax_command_html('#ajax_checkbox_value', (int)$form_state['values']['checkbox']);
- $commands[] = ajax_command_data('#ajax_checkbox_value', 'form_state_value_select', (int)$form_state['values']['checkbox']);
+ $commands[] = ajax_command_html('#ajax_checkbox_value', (int) $form_state['values']['checkbox']);
+ $commands[] = ajax_command_data('#ajax_checkbox_value', 'form_state_value_select', (int) $form_state['values']['checkbox']);
return array('#type' => 'ajax', '#commands' => $commands);
}
diff --git a/modules/simpletest/tests/batch.test b/modules/simpletest/tests/batch.test
index 54b29c8a9..451575cf2 100644
--- a/modules/simpletest/tests/batch.test
+++ b/modules/simpletest/tests/batch.test
@@ -352,7 +352,7 @@ class BatchPercentagesUnitTestCase extends DrupalUnitTestCase {
foreach ($this->testCases as $expected_result => $arguments) {
// PHP sometimes casts numeric strings that are array keys to integers,
// cast them back here.
- $expected_result = (string)$expected_result;
+ $expected_result = (string) $expected_result;
$total = $arguments['total'];
$current = $arguments['current'];
$actual_result = _batch_api_percentage($total, $current);
diff --git a/modules/simpletest/tests/database_test.test b/modules/simpletest/tests/database_test.test
index 09c310cd5..064ed3890 100644
--- a/modules/simpletest/tests/database_test.test
+++ b/modules/simpletest/tests/database_test.test
@@ -456,7 +456,7 @@ class DatabaseInsertTestCase extends DatabaseTestCase {
$query->execute();
$num_records_after = db_query('SELECT COUNT(*) FROM {test}')->fetchField();
- $this->assertIdentical($num_records_before + 1, (int)$num_records_after, t('Record inserts correctly.'));
+ $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.'));
}
diff --git a/modules/simpletest/tests/system_test.module b/modules/simpletest/tests/system_test.module
index a638b70f5..24167ced4 100644
--- a/modules/simpletest/tests/system_test.module
+++ b/modules/simpletest/tests/system_test.module
@@ -115,7 +115,7 @@ function system_test_basic_auth_page() {
}
function system_test_redirect($code) {
- $code = (int)$code;
+ $code = (int) $code;
if ($code != 200) {
header("Location: " . url('system-test/redirect/200', array('absolute' => TRUE)), TRUE, $code);
exit;
diff --git a/modules/simpletest/tests/xmlrpc.test b/modules/simpletest/tests/xmlrpc.test
index a9e8bca40..8ba943855 100644
--- a/modules/simpletest/tests/xmlrpc.test
+++ b/modules/simpletest/tests/xmlrpc.test
@@ -155,7 +155,7 @@ class XMLRPCValidator1IncTestCase extends DrupalWebTestCase {
for ($y = 2000; $y < 2002; $y++) {
for ($m = 3; $m < 5; $m++) {
for ($d = 1; $d < 6; $d++) {
- $ys = (string)$y;
+ $ys = (string) $y;
$ms = sprintf('%02d', $m);
$ds = sprintf('%02d', $d);
$struct_7[$ys][$ms][$ds]['moe'] = mt_rand(-100, 100);