? simpletest
? simpletest_drupal5.patch
Index: drupal_test_case.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/drupal_test_case.php,v
retrieving revision 1.26
diff -u -r1.26 drupal_test_case.php
--- drupal_test_case.php	15 Oct 2006 04:28:59 -0000	1.26
+++ drupal_test_case.php	22 Jun 2007 19:34:28 -0000
@@ -24,6 +24,70 @@
     }
     $this->WebTestCase($label);
   }
+  
+  /**
+   * @abstract Checks to see if we need to send 
+   * a http-auth header to authenticate
+   * when browsing a site.
+   *
+   * @param status Boolean pass true if you want to know if we are using 
+   * HTTP-AUTH
+   * @return void
+   */
+  function drupalCheckAuth($status = false) {
+    $check = variable_get('simpletest_httpauth', false);
+    if( $status ) {
+      return $check;
+    }
+    if( variable_get('simpletest_httpauth', false) ) {
+      $html = $this->authenticate( variable_get('simpletest_httpauth_username', ''), variable_get('simpletest_httpauth_pass', '') );
+    }
+    return $html;
+  }
+
+  /**
+   * @abstract Brokder for the get function
+   * addes the authetnication headers if 
+   * neccessary
+   * @author Earnest Berry III <earnest.berry@gmail.com>
+   *
+   * @param url string Url to retch
+   * @return void
+   */
+  function drupalGet($url) {
+    $html = $this->_browser->get($url);
+    
+    if( $this->drupalCheckAuth(true) ) {
+      $html .= $this->drupalCheckAuth();
+    }
+    
+    $this->_content = $this->_browser->getContent();
+    
+    return $html;
+  }
+
+  /**
+   * @abstract Brokder for the post function
+   * addes the authetnication headers if 
+   * neccessary
+   * @author Earnest Berry III <earnest.berry@gmail.com>
+   *
+   * @param url string Url to retch
+   * @return void
+   */
+  function drupalRawPost($action, $edit = array()) {
+    $html = $this->_browser->post($action, $edit);
+    
+    if( $this->drupalCheckAuth(true) ) {
+      $html .= $this->drupalCheckAuth();
+    }
+    
+    $this->_content = $this->_browser->getContent();
+    
+    return $html;
+  }
+
+  
 
   /**
    * Do a post request on a drupal page.
@@ -36,15 +100,25 @@
    * @param string  $submit    name of the submit button, untranslated
    * @param boolean $reporting assertations or not
    */
-  function drupalPostRequest($path, $edit, $submit) {
+  function drupalPostRequest($path, $edit = array(), $submit, $edit_multi = array()) {
     $url = url($path, NULL, NULL, TRUE);
-    $ret = $this->_browser->get($url);
+    $ret = $this->drupalGet($url);
+
     $this->assertTrue($ret, " [browser] GET $url");
     foreach ($edit as $field_name => $field_value) {
       $ret = $this->_browser->setFieldByName($field_name, $field_value)
           || $this->_browser->setFieldById("edit-$field_name", $field_value);
       $this->assertTrue($ret, " [browser] Setting $field_name=\"$field_value\"");
     }
+    
+    // Mutli-values
+    foreach( $edit_multi as $field_name => $field_values) {
+      $ret = $this->assertFieldById( "edit-$field_name") || $this->assertFieldByName( $field_name );
+      $this->assertTrue($ret, " [browser] Asserting multi-field $field_name=\"(" . implode(',', $field_values) . ")\"");
+      $ret = $this->setFieldById( "edit-$field_name", $field_values );
+      $this->assertTrue($ret, " [browser] Setting multi-field $field_name=\"(" . implode(',', $field_values) . ")\"");
+    }
+    
     $ret = $this->_browser->clickSubmit(t($submit));
 //    $ret = $this->_browser->clickSubmitByName('op');
     $this->assertTrue($ret, ' [browser] POST by click on ' . t($submit));
@@ -117,11 +191,12 @@
       return TRUE;
     }
     include_once './includes/install.inc';
+    module_rebuild_cache(); // Rebuild the module cache
     if (drupal_get_installed_schema_version($name, TRUE) == SCHEMA_UNINSTALLED) {
       drupal_install_modules(array($name));
     }
     else {
-      module_enable($name);
+      $try = module_enable(array($name));
     }
     module_list(TRUE, FALSE);
     if(module_exists($name)) {
@@ -258,9 +333,10 @@
     $edit = array('name' => $user->name, 'pass' => $user->pass_raw);
     $this->drupalPostRequest('user', $edit, 'Log in');
 
-    $this->assertWantedText($user->name, ' [login] found name: ' . $user->name);
-    $this->assertNoUnwantedText(t('The username %name has been blocked.', array('%name' => $user->name)), ' [login] not blocked');
-    $this->assertNoUnwantedText(t('The name %name is a reserved username.', array('%name' => $user->name)), ' [login] not reserved');
+    $this->assertNoText(t('The username %name has been blocked.', array('%name' => $user->name)), ' [login] not blocked');
+    $this->assertNoText(t('The name %name is a reserved username.', array('%name' => $user->name)), ' [login] not reserved');
+    $this->drupalGet( url('user', NULL, NULL, TRUE) );
+    $this->assertText( $user->name, ' [login] found name: ' . $user->name);
 
     return $user;
   }
@@ -614,4 +690,4 @@
 
 
 }
-?>
\ No newline at end of file
+?>
Index: simpletest.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/simpletest.info,v
retrieving revision 1.2
diff -u -r1.2 simpletest.info
--- simpletest.info	2 Sep 2006 18:56:57 -0000	1.2
+++ simpletest.info	22 Jun 2007 19:34:28 -0000
@@ -1,3 +1,5 @@
-; $Id: simpletest.info,v 1.2 2006/09/02 18:56:57 rokZlender Exp $
-name = Simpletest
-description = Allows to run unit tests on the Drupal codebase.
+; $Id $
+name = "SimpleTest module"
+description = "Provides simpletest classes to developers as well as some standard tests for Drupal"
+package = Simpletest
+version = "$Name$"
\ No newline at end of file
Index: simpletest.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/simpletest.module,v
retrieving revision 1.21
diff -u -r1.21 simpletest.module
--- simpletest.module	25 Dec 2006 11:43:39 -0000	1.21
+++ simpletest.module	22 Jun 2007 19:34:28 -0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: simpletest.module,v 1.21 2006/12/25 11:43:39 rokZlender Exp $
+// $Id: simpletest.module,v 1.15.2.1 2007/02/25 12:20:34 rokZlender Exp $
 
 /**
  * Implementation of hook_help().
@@ -28,6 +28,10 @@
     $items[] = array('path' => 'admin/simpletest', 'title' => 'simpletest',
                      'callback' => 'simpletest_entrypoint',
                      'access' => user_access('administer unit tests'));
+    $items[] = array('path' => 'admin/simpletest/settings', 'title' => t('simpletest'),
+      'callback' => 'drupal_get_form',
+      'callback arguments' => 'simpletest_settings',
+      'access' => user_access('administer unit tests'));
     return $items;
   }
 }
@@ -101,42 +105,67 @@
      */
     return '&nbsp;';  
   }  
-  $op = $_POST['op'];
-  $edit = $_POST;
-  if (empty($op)) {
-		$op = arg(2);
+	$output = drupal_get_form('simpletest_overview_form');
+	
+	if (simpletest_running_output()) {
+	  print theme('page',  simpletest_running_output() . $output);
+	} else {
+	  print theme('page', $output);	
 	}
-	switch ($op) {
-		case t('Run All Tests'):
+}
+
+function simpletest_running_output($output = NULL) {
+  static $o;
+  if ($output != NULL) {
+    $o = $output;
+  }
+  return $o;
+}
+
+/**
+ * FAPI form submit for simpletest_overview_form
+ *
+ * @param $form_id 
+ * @param $form_values
+ */
+function simpletest_overview_form_submit($form_id, $form_values) {
+  
+  switch ($form_values['running_options']){
+    
+    case 'all_tests':
       $output  = simpletest_run_tests();
-  		break;
-		
-		case t('Run Selected Tests'):
-		  $tests_list = array();
-			foreach($edit as $test => $checked) {
-				if ($checked && ($test != 'form_id') && ($test != 'op') && ($test != 'form_token')) {
-					$tests_list[] = $test;
-				}
-			}
-			if (count($tests_list) > 0 ) {
-				$output = simpletest_run_tests($tests_list);  	 	 
+    break;    
+    
+    case 'selected_tests':
+      $test_list = array();
+      foreach ($form_values as $test => $checked){
+        if ($checked && ($test != 'running_options' && $test != 'op' && $test != 'form_token' && $test != 'form_id')) {
+          $tests_list[] = $test;
+        }
+      }
+      if (count($tests_list) > 0 ) {
+				$output = simpletest_run_tests($tests_list);
 			}
 			else { 
 				// no test has been selected
 				drupal_set_message(t('No test has been selected.'), 'error');
-				/** @FIXME!!! */
-//				$output = form_submit(t('Back to Menu'));
-//				$output = form($output);
 			}
-			break;
-		default:
-			$output = drupal_get_form('simpletest_overview_form');
+    break;  
+    
+    default:
+      drupal_set_message(t('No test has been selected.'), 'error');
   }
-	print theme('page', $output);	
+  
+  simpletest_running_output($output);
+  return false;
 }
 
+/**
+ * Create simpletest_overview_form 
+ */
 function simpletest_overview_form() {
   $output = array();
+  
   $total_test = &simpletest_get_total_test();
   
   $test_instances = $total_test->getTestInstances();
@@ -154,13 +183,16 @@
                     array('#type' => 'fieldset', '#collapsible' => TRUE, '#collapsed' => FALSE,
                           '#title' => $group_test->getLabel()));
   }
-  $submit[] = array('#type' => 'submit', '#value' => t('Run All Tests'));
-  $submit[] = array('#type' => 'submit', '#value' => t('Run Selected Tests'));
+  
+  $submit['running_options'] = array('#type' => 'radios', '#default_value' => 'selected_tests', 
+                    '#options' => array('all_tests' => t('Run all tests (WARNING, this may take a long time)'), 'selected_tests' => t('Run selected tests')));
+  $submit['op'] = array('#type' => 'submit', '#value' => t('Begin'));
   $output[] = array_merge($submit,
-                  array('#type' => 'fieldset', '#collapsible' => FALSE, '#collapsed' => FALSE, '#title' => 'Run tests', '#description' => t('WARNING, this may take a long time.')));
+                  array('#type' => 'fieldset', '#collapsible' => FALSE, '#collapsed' => FALSE, '#title' => 'Run tests'));
   return $output;
 }
 
+
 /**
  * Actually runs tests
  * @param array $testlist list of tests to run or DEFAULT NULL run all tests
@@ -209,4 +241,29 @@
     return new DrupalUnitTests($classes);
   }
   return $total_test;
-}
\ No newline at end of file
+}
+
+
+function simpletest_settings() {
+  $from = array();
+
+  $form['http_auth'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('HTTP-AUTH Settings'),
+    '#description' => t('Auth settings'));
+  $form['http_auth']['simpletest_httpauth'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Use http-auth'),
+    '#default_value' => variable_get('simpletest_httpauth', false));
+  $form['http_auth']['simpletest_httpauth_username'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Username'),
+    '#default_value' => variable_get('simpletest_httpauth_username', ''));
+  $form['http_auth']['simpletest_httpauth_pass'] = array(
+    '#title' => t('Password'),
+    '#type' => 'password',
+    '#default_value' => variable_get('simpletest_httpauth_pass', ''));
+  
+  return system_settings_form($form);
+
+}
Index: tests/image_module.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/tests/image_module.test,v
retrieving revision 1.9
diff -u -r1.9 image_module.test
--- tests/image_module.test	15 Oct 2006 04:27:46 -0000	1.9
+++ tests/image_module.test	22 Jun 2007 19:34:28 -0000
@@ -89,11 +89,11 @@
     $this->drupalPostRequest('node/add/image', $edit, 'Submit');
     $content = $this->_browser->getContent();
     // test message
-    $this->assertWantedRaw(t('Your %post has been created.', array('%post' => 'image')), "Checking message");
+    $this->assertWantedRaw(t('Your %post has been created.', array('%post' => 'Image')), "Checking message");
     
     // get node nid
     $node = node_load(array('title' => $title));
-    $this->_browser->get(url("node/$node->nid", NULL, NULL, TRUE));
+    $this->drupalGet(url("node/$node->nid", NULL, NULL, TRUE));
     $content = $this->_browser->getContent();
     $this->assertWantedText($title, "Checking title : $title");
     $this->assertWantedText($description, "Checking body: $description");
@@ -101,9 +101,12 @@
     // sprawdz czy obrazek jest dobry
     preg_match_all('~<img.*?src="?([^"]*png?)"?[^>]*>~i', $content, $matches);
     $found = false;
-    
+   
+    // TODO Make is to that getimagesize goes green on HTTP-AUTH
+    // right now it will get denied.
     foreach($matches[1] as $file) {
       if (strripos($file, "TestGD")) {
+        error_log("Checking file: $file");
         $size = getimagesize($file);
         if ($size == $my_size) {
           $found = true;
@@ -122,7 +125,7 @@
     $edit = array('title' => $title, 'body' => $description, 'files[image]' => $img_path);
     $this->drupalPostRequest('node/'. $node->nid .'/edit', $edit, 'Submit' );
     $content = $this->_browser->getContent();
-    $this->_browser->get(url("node/$node->nid"));
+    $this->drupalGet(url("node/$node->nid"));
     $this->assertWantedText($title, "Checking title : $title");
     $this->assertWantedText($description, "Checking body: $description");
 
Index: tests/page_creation.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/tests/page_creation.test,v
retrieving revision 1.10
diff -u -r1.10 page_creation.test
--- tests/page_creation.test	15 Oct 2006 04:27:14 -0000	1.10
+++ tests/page_creation.test	22 Jun 2007 19:34:28 -0000
@@ -27,7 +27,7 @@
     $edit['body']     = '!SimpleTest test body! ' . $this->randomName(32) . ' ' . $this->randomName(32);
     $this->drupalPostRequest('node/add/page', $edit, 'Submit');
     
-    $this->assertWantedRaw(t('Your %post has been created.', array ('%post' => 'page')), 'Page created');
+    $this->assertWantedRaw(t('Your %post has been created.', array ('%post' => 'Page')), 'Page created');
     
     $node = node_load(array('title' => $edit['title']));
     $this->assertNotNull($node, 'Node found in database. %s');
Index: tests/page_view.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/tests/page_view.test,v
retrieving revision 1.7
diff -u -r1.7 page_view.test
--- tests/page_view.test	9 Aug 2006 11:48:47 -0000	1.7
+++ tests/page_view.test	22 Jun 2007 19:34:28 -0000
@@ -41,14 +41,14 @@
     $this->assertNotNull(node_load($node->nid), 'Node created');
 
     /* Tries to edit with anonymous user */
-    $html = $this->get(url("node/$node->nid/edit", NULL, NULL, TRUE));
+    $html = $this->drupalGet(url("node/$node->nid/edit", NULL, NULL, TRUE));
     $this->assertResponse(403);
     
     /* Prepare a user to request the node view */
     $test_user = $this->drupalCreateUserRolePerm(array('access content'));
     $this->drupalLoginUser($test_user);
     
-    $html = $this->get(url("node/$node->nid/edit", NULL, NULL, TRUE));
+    $html = $this->drupalGet(url("node/$node->nid/edit", NULL, NULL, TRUE));
     $this->assertResponse(403);
     
     $test_user = $this->drupalCreateUserRolePerm(array('administer nodes'));
Index: tests/profile_module.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/tests/profile_module.test,v
retrieving revision 1.10
diff -u -r1.10 profile_module.test
--- tests/profile_module.test	2 Sep 2006 18:03:59 -0000	1.10
+++ tests/profile_module.test	22 Jun 2007 19:34:28 -0000
@@ -950,7 +950,7 @@
     $this->_browser->get(url("profile/". $form_name. "/$choice"));
     $title = str_replace("%value", $choice, $page_title);
 
-    $this->assertTitle($title. ' | '. variable_get('site_name', 'drupal'), "Checking title $title");
+    $this->assertTitle($title. ' | '. variable_get('site_name', 'Drupal'), "Checking title $title");
     $this->assertWantedText($title, "Checking $title in content");
     $delete_fields[] = $fid;
 
Index: tests/taxonomy.module.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/tests/taxonomy.module.test,v
retrieving revision 1.6
diff -u -r1.6 taxonomy.module.test
--- tests/taxonomy.module.test	15 Oct 2006 04:26:44 -0000	1.6
+++ tests/taxonomy.module.test	22 Jun 2007 19:34:28 -0000
@@ -23,7 +23,8 @@
     $maxNodes = rand(1, count($nodesList));
     $nodes = array();
     for($i = 0; $i < $maxNodes; $i++) {
-      $nodes[] = $nodesList[$i];
+      $nodes[$nodesList[$i]] = $nodesList[$i];
+      $nodesBak[] = $nodesList[$i];
     }
     $_t = array('vid', 'name', 'description', 'help', 'relations', 'hierarchy', 'multiple',
       'required', 'tags', 'module', 'weight', 'nodes');
@@ -33,6 +34,9 @@
    
     // exec save function
     taxonomy_save_vocabulary($edit);
+    //after save we use $nodesBak
+    sort($nodesBak);
+    $edit['nodes'] = $nodesBak;
     $vocabularies = taxonomy_get_vocabularies();
     foreach($vocabularies as $voc) {
       if ($voc->name == $name) {
@@ -236,7 +240,7 @@
   }
 
   function testTaxonomyNode() {
-    $this->drupalModuleEnable('story');
+    //$this->drupalModuleEnable('story');
     
     //preparing data
     // vocabulary hierarchy->single, multiple -> on
@@ -260,28 +264,28 @@
     
     // create 1st term
     $termname = $this->randomName(20);
-    $data = array('name' => $termname, 'description' => '', 'weight' => 0, 'synonyms' => '', 'vid' => $edit['vid'], 'tid' => 0, 'relations' => 0);
+    $data = array('name' => $termname, 'description' => '', 'weight' => 0, 'synonyms' => '', 'vid' => $vid, 'tid' => 0, 'relations' => 0);
     taxonomy_save_term($data);
     $_tArray = taxonomy_get_term_by_name($termname);
-    $parent[] = $_tArray[0]->tid;
+    $parent[$_tArray[0]->tid] = $_tArray[0]->tid;
     $patternArray['term name 1'] = $termname;
-    
+    #die(); 
     // create 2nd term
     $termname = $this->randomName(20);
-    $data = array('name' => $termname, 'description' => '', 'weight' => 0, 'synonyms' => '', 'vid' => $edit['vid'], 'tid' => 0, 'relations' => 0);
+    $data = array('name' => $termname, 'description' => '', 'weight' => 0, 'synonyms' => '', 'vid' => $vid, 'tid' => 0, 'relations' => 0);
     taxonomy_save_term($data);
     $_tArray = taxonomy_get_term_by_name($termname);
-    $parent[] = $_tArray[0]->tid;
+    $parent[$_tArray[0]->tid] = $_tArray[0]->tid;
     $patternArray['term name 2'] = $termname;
 
     // create test user and login
-    $perm = array('access content', 'create stories', 'edit own stories');
+    $perm = array('access content', 'create story content', 'edit story content');
     $account = $this->drupalCreateUserRolePerm($perm);
     $this->drupalLoginUser($account);
     
     // why is this printing out the user profile page?
     // go to node/add/story
-    $this->_browser->get(url('node/add/story', NULL, NULL, TRUE));
+    $this->drupalGet(url('node/add/story', NULL, NULL, TRUE));
     $req = $this->_browser->getRequest();
 
     $headers = $this->_browser->getHeaders();
@@ -292,20 +296,26 @@
     // try to create story
     $title = $this->randomName();
     $body = $this->randomName(100);
-    $edit = array('edit[title]' => $title, 'edit[body]' => $body, 'edit[taxonomy][]' => $parent);
+    $edit = array('title' => $title, 'body' => $body);
+
+    // Mutli-selects must be handles diffrently
+    // than other form/field types
+    $edit_multi = array('taxonomy-' . $vid => $parent);
+    
     // multiple slect box was failing through drupalPostRequest. Use raw POST instead
+    // Failing because they were being sent/handled wrong (earnest.berry@gmail.com <Souvent22>)
     $action = url('node/add/story', NULL, NULL, TRUE);
-    $this->post($action, $edit);
+    $this->drupalPostRequest($action, $edit, 'Submit', $edit_multi);
     $content = $this->drupalGetContent();
-//    die('fff   '. $content);
     $patternArray['body text'] = $body;
     $patternArray['title'] = $title;
 
 //    $node = array2object(node_load(array('title' => $title)));
     $node = node_load(array('title' => $title));
+    
     $this->_browser->get(url("node/$node->nid"));
     foreach($patternArray as $name => $termPattern) {
-      $this->assertWantedText($termPattern, "Checking $name");
+      $this->assertText($termPattern, "Checking $name");
     }
     
     // checking database fields
@@ -334,12 +344,17 @@
     $parent[] = $_tArray[0]->tid;
     $patternArray['term name 3'] = $termname;
 
-    $edit = array('title' => $title, 'body' => $body, 'taxonomy][' => $parent);
-    $this->drupalPostRequest('node/'. $node->nid .'/edit', $edit, 'Submit' );
+    $edit = array('title' => $title, 'body' => $body);
+    // Mutli-selects must be handles diffrently
+    // than other form/field types
+    $edit_multi = array('taxonomy-' . $vid => $parent);
+    
+    $this->drupalPostRequest('node/'. $node->nid .'/edit', $edit, 'Submit', $edit_multi);
 
-    $patternArray['information message'] = t('The story was updated');
+    // TODO Do a MUCH better check here of the information msg
+    $patternArray['information message'] = 'been updated';
     foreach($patternArray as $name => $termPattern) {
-      $this->assertWantedText($termPattern, "Checking $name");
+      $this->assertText($termPattern, "Checking $name");
     }
     
     // checking database fields
Index: tests/upload_tests.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/tests/upload_tests.test,v
retrieving revision 1.7
diff -u -r1.7 upload_tests.test
--- tests/upload_tests.test	2 Sep 2006 18:03:59 -0000	1.7
+++ tests/upload_tests.test	22 Jun 2007 19:34:28 -0000
@@ -65,10 +65,12 @@
   function _loginUser($user) {
     $edit = array('name' => $user->name, 'pass' => $user->pass_raw);
     $this->drupalPostRequest('user', $edit, 'Log in');
-
-    $this->assertWantedText($user->name, ' [login] found name: ' . $user->name);
-    $this->assertNoUnwantedText(t('The username %name has been blocked.', array('%name' => $user->name)), ' [login] not blocked');
-    $this->assertNoUnwantedText(t('The name %name is a reserved username.', array('%name' => $user->name)), ' [login] not reserved');
+    
+    
+    $this->assertNoText(t('The username %name has been blocked.', array('%name' => $user->name)), ' [login] not blocked');
+    $this->assertNoText(t('The name %name is a reserved username.', array('%name' => $user->name)), ' [login] not reserved');
+    $this->drupalGet( url('user', NULL, NULL, TRUE) );
+    $this->assertText($user->name, ' [login] found name: ' . $user->name);
   }
 
   /**
@@ -385,8 +387,7 @@
       $pic_path = file_directory_path() .'/'.$picture_dir .'/picture-'.$user->uid.'.jpg';
 
       // get full url to the user's image
-      $picture = file_create_url($pic_path);
-      
+      $picture = file_create_url($pic_path);  
 
       // check if image is displayed in user's profile page
       $content = $this->drupalGetContent();
Index: tests/user_access.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/tests/user_access.test,v
retrieving revision 1.3
diff -u -r1.3 user_access.test
--- tests/user_access.test	27 Aug 2006 10:13:39 -0000	1.3
+++ tests/user_access.test	22 Jun 2007 19:34:28 -0000
@@ -40,7 +40,7 @@
     $this->drupalPostRequest('user/register', $edit, 'Create new account');
     
     $this->assertNoUnWantedText(t('Your password and further instructions have been sent to your e-mail address.'), 'blocked user: Your password and further instructions - not found');
-    $this->assertwantedText(t('The name @name has been denied access.', array('@name' => $name)), 'blocked user: denied access - found');
+    $this->assertText(t('The name @name has been denied access.', array('@name' => $name)), 'blocked user: denied access - found');
     
     /* Lets make a new browser for new cookies */
     $this->setBrowser($this->createBrowser());
@@ -53,8 +53,8 @@
     
     $this->drupalPostRequest('user/register', $edit, 'Create new account');
     
-    $this->assertWantedText(t('Your password and further instructions have been sent to your e-mail address.'), 'access user: Your password and further instructions - found');
-    $this->assertNoUnwantedText(t('The name @name has been denied access.', array('@name' => $name)), 'access user: denied access - not found');
+    $this->assertText(t('Your password and further instructions have been sent to your e-mail address.'), 'access user: Your password and further instructions - found');
+    $this->assertNoText(t('The name @name has been denied access.', array('@name' => $name)), 'access user: denied access - not found');
 
     $user = user_load($edit);
     
@@ -68,4 +68,4 @@
     }
   }
 }
-?>
\ No newline at end of file
+?>
Index: tests/user_registration_test.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/tests/user_registration_test.test,v
retrieving revision 1.9
diff -u -r1.9 user_registration_test.test
--- tests/user_registration_test.test	6 Sep 2006 08:11:50 -0000	1.9
+++ tests/user_registration_test.test	22 Jun 2007 19:34:28 -0000
@@ -22,8 +22,8 @@
                   'mail' => $mail);
     $this->drupalPostRequest('user/register', $edit, 'Create new account');
     
-    $this->assertWantedText(t('Your password and further instructions have been sent to your e-mail address.'), 'Your password and further instructions ... found');
-    $this->assertNoUnwantedText(t('The name %name has been denied access.', array('%name' => $name)), 'not denied access');
+    $this->assertText(t('Your password and further instructions have been sent to your e-mail address.'), 'Your password and further instructions ... found');
+    $this->assertNoText(t('The name %name has been denied access.', array('%name' => $name)), 'not denied access');
     
     // now we check database fields
     // we can use an 'edit' array to load user variable
@@ -52,7 +52,7 @@
     /* We try to login with a wrong password */
     $login_edit = array('name' => $name, 'pass' => 'foo');
     $this->drupalPostRequest('user', $login_edit, 'Log in');
-    $this->assertWantedText(t('Sorry, unrecognized username or password.'), 'Test for failed Login');
+    $this->assertText(t('Sorry, unrecognized username or password. Have you forgotten your password?'), 'Test for failed Login');
     $url = user_pass_reset_url($user);
     /* TODO: find a better way, we currently have to do it that way, see user.module line 1041. */
     sleep(1);
@@ -60,25 +60,25 @@
     
     // Will proabaly not work localised as the text is sent to tranlate wrapped in <p> usually
 
-    $this->assertWantedText(t('This login can be used only once.'), "Check for 'used only once' notice");
+    $this->assertText(t('This login can be used only once.'), "Check for 'used only once' notice");
  
     $this->_browser->clickSubmit(t('Log in'));
-    $this->assertWantedText(t('You have just used your one-time login link. It is no longer necessary to use this link to login. Please change your password.'), "Check for one time login notice after clicking Login button.");
+    $this->assertText(t('You have just used your one-time login link. It is no longer necessary to use this link to login. Please change your password.'), "Check for one time login notice after clicking Login button.");
     
     /* now lets change our password */
     $new_pass = user_password();
     $this->assertTrue($this->_browser->setField('pass[pass1]', $new_pass), 'Pass1 field set.');
     $this->assertTrue($this->_browser->setField('pass[pass2]', $new_pass), 'Pass2 field set.');
     $this->_browser->clickSubmit();
-    $this->assertWantedText(t('The changes have been saved.'), "Changed password to '$new_pass'");
+    $this->assertText(t('The changes have been saved.'), "Changed password to '$new_pass'");
     
     /* Check if the password changes are present in db */
     $user = user_load(array('uid' => $user->uid));
     $this->assertEqual($user->pass, md5($new_pass), 'Correct password in database');
     
     /* logout */
-    $this->clickLink('log out'); 
-    $this->assertNoUnwantedText($user->name, 'Logged out');
+    $this->clickLink('Log out'); 
+    $this->assertNoText($user->name, 'Logged out');
     
     /* login again */
     $login_edit['pass'] = $new_pass;
@@ -87,11 +87,11 @@
     /** $pname = theme('placeholder', $user->name); /** @TODO: this one messes html tags->search fails */
     $pname = $user->name;
 
-    $this->assertWantedText($pname, 'Logged in (name found)');
-    $this->assertNoUnwantedText(t('Sorry. Unrecognized username or password.'), 'Logged in (not sorry)');
-    $this->assertNoUnwantedText(t('User login'), 'Logged in (no user login form present)');
-    $this->assertNoUnwantedText(t('The username %name has been blocked.', array('%name' => $pname)), 'Not blocked');
-    $this->assertNoUnwantedText(t('The name %name is a reserved username.', array('%name' => $pname)), 'Access granted');
+    $this->assertText($pname, 'Logged in (name found)');
+    $this->assertNoText(t('Sorry. Unrecognized username or password.'), 'Logged in (not sorry)');
+    $this->assertNoText(t('User login'), 'Logged in (no user login form present)');
+    $this->assertNoText(t('The username %name has been blocked.', array('%name' => $pname)), 'Not blocked');
+    $this->assertNoText(t('The name %name is a reserved username.', array('%name' => $pname)), 'Access granted');
 
     /* delete test user, roles and maybe authmap */
     db_query('DELETE FROM {users} WHERE uid = %d', $user->uid);
@@ -99,4 +99,4 @@
     db_query('DELETE FROM {authmap} WHERE uid = %d', $user->uid);
   }
 }
-?>
\ No newline at end of file
+?>
Index: tests/user_validation.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/tests/user_validation.test,v
retrieving revision 1.1
diff -u -r1.1 user_validation.test
--- tests/user_validation.test	24 Aug 2005 19:10:02 -0000	1.1
+++ tests/user_validation.test	22 Jun 2007 19:34:28 -0000
@@ -20,7 +20,7 @@
     $this->assertNotNull($result, 'Invalid chars in username');
   }
   function testMaxLengthName() {
-    $name = str_repeat('a', 57);
+    $name = str_repeat('a', 61);
     $result = user_validate_name($name);
     $this->assertNotNull($result, 'Excessively long username');
   }
