diff options
Diffstat (limited to 'modules/simpletest/tests')
-rw-r--r-- | modules/simpletest/tests/common.test | 6 | ||||
-rw-r--r-- | modules/simpletest/tests/database_test.install | 4 | ||||
-rw-r--r-- | modules/simpletest/tests/database_test.test | 16 | ||||
-rw-r--r-- | modules/simpletest/tests/file.test | 10 | ||||
-rw-r--r-- | modules/simpletest/tests/form.test | 10 | ||||
-rw-r--r-- | modules/simpletest/tests/image.test | 2 | ||||
-rw-r--r-- | modules/simpletest/tests/registry.test | 4 | ||||
-rw-r--r-- | modules/simpletest/tests/schema.test | 2 | ||||
-rw-r--r-- | modules/simpletest/tests/xmlrpc.test | 32 |
9 files changed, 43 insertions, 43 deletions
diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test index 76f50977b..3af7786e2 100644 --- a/modules/simpletest/tests/common.test +++ b/modules/simpletest/tests/common.test @@ -316,7 +316,7 @@ class DrupalHTTPRequestTestCase extends DrupalWebTestCase { $password = $this->randomName(); $url = url('system-test/auth', array('absolute' => TRUE)); - $auth = str_replace('http://', 'http://' . $username . ':' . $password .'@', $url); + $auth = str_replace('http://', 'http://' . $username . ':' . $password . '@', $url); $result = drupal_http_request($auth); $this->drupalSetContent($result->data); @@ -711,7 +711,7 @@ class ValidUrlTestCase extends DrupalWebTestCase { foreach ($valid_relative_urls as $url) { $test_url = $front . $url; $valid_url = valid_url($test_url); - $this->assertTrue($valid_url,t('@url is a valid url.', array('@url' => $test_url))); + $this->assertTrue($valid_url, t('@url is a valid url.', array('@url' => $test_url))); } } } @@ -730,7 +730,7 @@ class ValidUrlTestCase extends DrupalWebTestCase { foreach ($invalid_relative_urls as $url) { $test_url = $front . $url; $valid_url = valid_url($test_url); - $this->assertFALSE($valid_url,t('@url is NOT a valid url.', array('@url' => $test_url))); + $this->assertFALSE($valid_url, t('@url is NOT a valid url.', array('@url' => $test_url))); } } } diff --git a/modules/simpletest/tests/database_test.install b/modules/simpletest/tests/database_test.install index 30dd238c0..e16c0ad81 100644 --- a/modules/simpletest/tests/database_test.install +++ b/modules/simpletest/tests/database_test.install @@ -64,7 +64,7 @@ function database_test_schema() { 'length' => 255, 'not null' => TRUE, 'default' => '', - ), + ), 'age' => array( 'description' => "The person's age", 'type' => 'int', @@ -109,7 +109,7 @@ function database_test_schema() { 'description' => 'Simple unique ID.', 'type' => 'serial', 'not null' => TRUE, - ), + ), 'blob1' => array( 'description' => 'A dummy BLOB field.', 'type' => 'blob', diff --git a/modules/simpletest/tests/database_test.test b/modules/simpletest/tests/database_test.test index 2fa7f6c8f..6a5faa538 100644 --- a/modules/simpletest/tests/database_test.test +++ b/modules/simpletest/tests/database_test.test @@ -769,7 +769,7 @@ class DatabaseUpdateComplexTestCase extends DatabaseTestCase { $num_updated = db_update('test') ->condition('name', 'Ringo') ->fields(array('job' => 'Musician')) - ->expression('age', 'age + :age',array(':age' => 4)) + ->expression('age', 'age + :age', array(':age' => 4)) ->execute(); $this->assertIdentical($num_updated, 1, t('Updated 1 record.')); @@ -790,7 +790,7 @@ class DatabaseUpdateComplexTestCase extends DatabaseTestCase { $before_age = db_query("SELECT age FROM {test} WHERE name = 'Ringo'")->fetchField(); $num_updated = db_update('test') ->condition('name', 'Ringo') - ->expression('age', 'age + :age',array(':age' => 4)) + ->expression('age', 'age + :age', array(':age' => 4)) ->execute(); $this->assertIdentical($num_updated, 1, t('Updated 1 record.')); @@ -1643,7 +1643,7 @@ class DatabaseSelectPagerDefaultTestCase extends DatabaseTestCase { if (!($num_pages * $limit < $count)) { $num_pages--; } - + for ($page = 0; $page <= $num_pages; ++$page) { $this->drupalGet('database_test/pager_query_even/' . $limit, array('query' => array('page' => $page))); $data = json_decode($this->drupalGetContent()); @@ -1769,7 +1769,7 @@ class DatabaseSelectTableSortDefaultTestCase extends DatabaseTestCase { $this->assertEqual($last->task, $sort['last'], t('Items appear in the correct order.')); } } - + /** * Confirm that if a tablesort's orderByHeader is called before another orderBy, that the header happens first. * @@ -2391,7 +2391,7 @@ class DatabaseInvalidDataTestCase extends DatabaseTestCase { // Ensure the other values were not inserted. $record = db_select('test') ->fields('test', array('name', 'age')) - ->condition('age', array(17, 75),'IN') + ->condition('age', array(17, 75), 'IN') ->execute()->fetchObject(); $this->assertFalse($record, t('The rest of the insert aborted as expected.')); @@ -2596,7 +2596,7 @@ class DatabaseTransactionTestCase extends DatabaseTestCase { $saved_age = db_query("SELECT age FROM {test} WHERE name = :name", array(':name' => 'DanielB'))->fetchField(); $this->assertNotIdentical($saved_age, '19', t('Cannot retrieve DanielB row after commit.')); } - catch(Exception $e) { + catch (Exception $e) { $this->fail($e->getMessage()); } } @@ -2622,7 +2622,7 @@ class DatabaseTransactionTestCase extends DatabaseTestCase { $saved_age = db_query("SELECT age FROM {test} WHERE name = :name", array(':name' => 'DanielB'))->fetchField(); $this->assertIdentical($saved_age, '19', t('DanielB not rolled back, since transactions are not supported.')); } - catch(Exception $e) { + catch (Exception $e) { $this->fail($e->getMessage()); } } @@ -2644,7 +2644,7 @@ class DatabaseTransactionTestCase extends DatabaseTestCase { $saved_age = db_query("SELECT age FROM {test} WHERE name = :name", array(':name' => 'DanielA'))->fetchField(); $this->assertIdentical($saved_age, '19', t('Can retrieve DanielA row after commit.')); } - catch(Exception $e) { + catch (Exception $e) { $this->fail($e->getMessage()); } } diff --git a/modules/simpletest/tests/file.test b/modules/simpletest/tests/file.test index 7afc6f5c8..b68fef7dd 100644 --- a/modules/simpletest/tests/file.test +++ b/modules/simpletest/tests/file.test @@ -705,13 +705,13 @@ class FileDirectoryTest extends FileTestCase { $this->assertDirectoryPermissions($directory, variable_get('file_chmod_directory', 0775)); // Remove .htaccess file to then test that it gets re-created. - @unlink(file_directory_path() .'/.htaccess'); + @unlink(file_directory_path() . '/.htaccess'); $directory = file_directory_path(); file_check_directory($directory); $this->assertTrue(is_file(file_directory_path() . '/.htaccess'), t('Successfully created the .htaccess file in the files directory.'), 'File'); // Verify contents of .htaccess file. - $file = file_get_contents(file_directory_path() .'/.htaccess'); + $file = file_get_contents(file_directory_path() . '/.htaccess'); $this->assertEqual($file, "SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006\nOptions None\nOptions +FollowSymLinks", t('The .htaccess file contains the proper content.'), 'File'); } @@ -773,14 +773,14 @@ class FileDirectoryTest extends FileTestCase { // directory. $basename = 'xyz.txt'; $directory = 'misc'; - $original = $directory .'/'. $basename; + $original = $directory . '/' . $basename; $path = file_create_filename($basename, $directory); $this->assertEqual($path, $original, t('New filepath %new equals %original.', array('%new' => $path, '%original' => $original)), 'File'); // Then we test against a file that already exists within that directory. $basename = 'druplicon.png'; - $original = $directory .'/'. $basename; - $expected = $directory .'/druplicon_0.png'; + $original = $directory . '/' . $basename; + $expected = $directory . '/druplicon_0.png'; $path = file_create_filename($basename, $directory); $this->assertEqual($path, $expected, t('Creating a new filepath from %original equals %new.', array('%new' => $path, '%original' => $original)), 'File'); diff --git a/modules/simpletest/tests/form.test b/modules/simpletest/tests/form.test index 79eb5a1ad..c06a452d9 100644 --- a/modules/simpletest/tests/form.test +++ b/modules/simpletest/tests/form.test @@ -42,7 +42,7 @@ class FormsTestCase extends DrupalWebTestCase { $elements['radios']['element'] = array('#title' => $this->randomName(), '#type' => 'radios', '#required' => TRUE, '#options' => array($this->randomName(), $this->randomName(), $this->randomName())); $elements['radios']['empty_values'] = $empty_arrays; - $elements['checkboxes']['element'] = array('#title' => $this->randomName(), '#type' => 'checkboxes', '#required' => TRUE,'#options' => array($this->randomName(), $this->randomName(), $this->randomName())); + $elements['checkboxes']['element'] = array('#title' => $this->randomName(), '#type' => 'checkboxes', '#required' => TRUE, '#options' => array($this->randomName(), $this->randomName(), $this->randomName())); $elements['checkboxes']['empty_values'] = $empty_arrays; $elements['select']['element'] = array('#title' => $this->randomName(), '#type' => 'select', '#required' => TRUE, '#options' => array($this->randomName(), $this->randomName(), $this->randomName())); @@ -142,7 +142,7 @@ class FormsElementsTableSelectFunctionalTest extends DrupalWebTestCase { $this->assertFieldByXPath('//th[@class="select-all"]', NULL, t('Presence of the "Select all" checkbox.')); $rows = array('row1', 'row2', 'row3'); - foreach($rows as $row) { + foreach ($rows as $row) { $this->assertFieldByXPath('//input[@type="checkbox"]', $row, t('Checkbox for value @row.', array('@row' => $row))); } } @@ -159,7 +159,7 @@ class FormsElementsTableSelectFunctionalTest extends DrupalWebTestCase { $this->assertNoFieldByXPath('//th[@class="select-all"]', '', t('Absence of the "Select all" checkbox.')); $rows = array('row1', 'row2', 'row3'); - foreach($rows as $row) { + foreach ($rows as $row) { $this->assertFieldByXPath('//input[@type="radio"]', $row, t('Radio button for value @row.', array('@row' => $row))); } } @@ -411,7 +411,7 @@ class FormsFormStorageTestCase extends DrupalWebTestCase { * Tests using the form in a usual way. */ function testForm() { - + $user = $this->drupalCreateUser(array('access content')); $this->drupalLogin($user); @@ -432,7 +432,7 @@ class FormsFormStorageTestCase extends DrupalWebTestCase { $this->drupalPost('form_test/form-storage', array('title' => 'new', 'value' => 'value_is_set'), 'Continue', array('query' => 'cache=1')); $this->assertText('Form constructions: 1', t('The form has been constructed one time till now.')); - + $this->drupalPost(NULL, array(), 'Save', array('query' => 'cache=1')); $this->assertText('Form constructions: 2', t('The form has been constructed two times till now.')); $this->assertText('Title: new', t('The form storage has stored the values.')); diff --git a/modules/simpletest/tests/image.test b/modules/simpletest/tests/image.test index 21fb97ac9..d25d89582 100644 --- a/modules/simpletest/tests/image.test +++ b/modules/simpletest/tests/image.test @@ -392,7 +392,7 @@ class ImageToolkitGdTestCase extends DrupalWebTestCase { } // Perform our operation. - $function = 'image_'. $values['function']; + $function = 'image_' . $values['function']; $arguments = array(); $arguments[] = &$image; $arguments = array_merge($arguments, $values['arguments']); diff --git a/modules/simpletest/tests/registry.test b/modules/simpletest/tests/registry.test index 9a363849f..f8bebf905 100644 --- a/modules/simpletest/tests/registry.test +++ b/modules/simpletest/tests/registry.test @@ -143,8 +143,8 @@ class RegistrySkipBodyTestCase extends DrupalWebTestCase { 'group' => t('System'), ); } - - function testRegistrySkipBody () { + + function testRegistrySkipBody() { // This string contains all three kinds of opening braces. $function = '<?php function foo () { $x = "{$y}"; $x = "${y}"; }'; $tokens = token_get_all($function); diff --git a/modules/simpletest/tests/schema.test b/modules/simpletest/tests/schema.test index 968106c34..716bef282 100644 --- a/modules/simpletest/tests/schema.test +++ b/modules/simpletest/tests/schema.test @@ -103,7 +103,7 @@ class SchemaTestCase extends DrupalWebTestCase { function tryInsert($table = 'test_table') { try { - db_query("INSERT INTO {" . $table . "} (id) VALUES (:id)", array(':id' => mt_rand(10,20))); + db_query("INSERT INTO {" . $table . "} (id) VALUES (:id)", array(':id' => mt_rand(10, 20))); return TRUE; } catch (Exception $e) { diff --git a/modules/simpletest/tests/xmlrpc.test b/modules/simpletest/tests/xmlrpc.test index fb94911ad..8fa656be4 100644 --- a/modules/simpletest/tests/xmlrpc.test +++ b/modules/simpletest/tests/xmlrpc.test @@ -26,13 +26,13 @@ class XMLRPCValidator1IncTestCase extends DrupalWebTestCase { mt_srand(); - $array_1 = array(array('curly' => mt_rand(-100,100)), - array('curly' => mt_rand(-100,100)), - array('larry' => mt_rand(-100,100)), - array('larry' => mt_rand(-100,100)), - array('moe' => mt_rand(-100,100)), - array('moe' => mt_rand(-100,100)), - array('larry' => mt_rand(-100,100))); + $array_1 = array(array('curly' => mt_rand(-100, 100)), + array('curly' => mt_rand(-100, 100)), + array('larry' => mt_rand(-100, 100)), + array('larry' => mt_rand(-100, 100)), + array('moe' => mt_rand(-100, 100)), + array('moe' => mt_rand(-100, 100)), + array('larry' => mt_rand(-100, 100))); shuffle($array_1); $l_res_1 = xmlrpc_test_arrayOfStructsTest($array_1); $r_res_1 = xmlrpc($xml_url, 'validator1.arrayOfStructsTest', $array_1); @@ -45,7 +45,7 @@ class XMLRPCValidator1IncTestCase extends DrupalWebTestCase { $this->assertIdentical($l_res_2, $r_res_2, 'count the entities test: %s'); - $struct_3 = array('moe' => mt_rand(-100,100), 'larry' => mt_rand(-100,100), 'curly' => mt_rand(-100,100), 'homer' => mt_rand(-100,100)); + $struct_3 = array('moe' => mt_rand(-100, 100), 'larry' => mt_rand(-100, 100), 'curly' => mt_rand(-100, 100), 'homer' => mt_rand(-100, 100)); $l_res_3 = xmlrpc_test_easyStructTest($struct_3); $r_res_3 = xmlrpc($xml_url, 'validator1.easyStructTest', $struct_3); $this->assertIdentical($l_res_3, $r_res_3, 'easy struct test: %s'); @@ -59,10 +59,10 @@ class XMLRPCValidator1IncTestCase extends DrupalWebTestCase { $r_res_4 = xmlrpc($xml_url, 'validator1.echoStructTest', $struct_4); $this->assertIdentical($l_res_4, $r_res_4, 'echo struct test: %s'); - $int_5 = mt_rand(-100,100); + $int_5 = mt_rand(-100, 100); $bool_5 = (($int_5 % 2) == 0); $string_5 = $this->randomName(); - $double_5 = (double)(mt_rand(-1000,1000) / 100); + $double_5 = (double)(mt_rand(-1000, 1000) / 100); $time_5 = REQUEST_TIME; $base64_5 = $this->randomName(100); $l_res_5 = xmlrpc_test_manyTypesTest($int_5, $bool_5, $string_5, $double_5, xmlrpc_date($time_5), $base64_5); @@ -73,10 +73,10 @@ class XMLRPCValidator1IncTestCase extends DrupalWebTestCase { $this->assertEqual($l_res_5, $r_res_5, 'many types test: %s'); - $size = mt_rand(100,200); + $size = mt_rand(100, 200); $array_6 = array(); for ($i = 0; $i < $size; $i++) { - $array_6[] = $this->randomName(mt_rand(8,12)); + $array_6[] = $this->randomName(mt_rand(8, 12)); } $l_res_6 = xmlrpc_test_moderateSizeArrayCheck($array_6); @@ -91,9 +91,9 @@ class XMLRPCValidator1IncTestCase extends DrupalWebTestCase { $ys = (string)$y; $ms = sprintf('%02d', $m); $ds = sprintf('%02d', $d); - $struct_7[$ys][$ms][$ds]['moe'] = mt_rand(-100,100); - $struct_7[$ys][$ms][$ds]['larry'] = mt_rand(-100,100); - $struct_7[$ys][$ms][$ds]['curly'] = mt_rand(-100,100); + $struct_7[$ys][$ms][$ds]['moe'] = mt_rand(-100, 100); + $struct_7[$ys][$ms][$ds]['larry'] = mt_rand(-100, 100); + $struct_7[$ys][$ms][$ds]['curly'] = mt_rand(-100, 100); } } } @@ -102,7 +102,7 @@ class XMLRPCValidator1IncTestCase extends DrupalWebTestCase { $this->assertIdentical($l_res_7, $r_res_7, 'nested struct test: %s'); - $int_8 = mt_rand(-100,100); + $int_8 = mt_rand(-100, 100); $l_res_8 = xmlrpc_test_simpleStructReturnTest($int_8); $r_res_8 = xmlrpc($xml_url, 'validator1.simpleStructReturnTest', $int_8); $this->assertIdentical($l_res_8, $r_res_8, 'nested struct test: %s'); |