Index: tests/image_module.test
===================================================================
RCS file: /cvs/drupal/contributions/modules/simpletest/tests/image_module.test,v
retrieving revision 1.13
diff -u -p -r1.13 image_module.test
--- tests/image_module.test	5 Jan 2008 10:21:57 -0000	1.13
+++ tests/image_module.test	21 Jan 2008 00:08:56 -0000
@@ -8,14 +8,13 @@ class ImageModuleTest extends DrupalTest
   }
   
   function setUp() {
-  	parent::setUp();
-  	$dir = file_directory_path().'/'.variable_get('image_default_path', 'images');
-  	$temp_dir = $dir.'/temp';
-  	$dir_created = file_check_directory($dir, TRUE);
-  	$temp_dir_created = file_check_directory($temp_dir, TRUE);
+    parent::setUp();
+    $dir = file_directory_path().'/'.variable_get('image_default_path', 'images');
+    $temp_dir = $dir.'/temp';
+    $dir_created = file_check_directory($dir, TRUE);
+    $temp_dir_created = file_check_directory($temp_dir, TRUE);
     if(!$dir_created || !$temp_dir_created) {
-      print("Images dir could not be create");
-      exit();
+      $this->assertTrue(false, "Temp image directory could not be created");
     }
   }
   
@@ -86,17 +85,16 @@ class ImageModuleTest extends DrupalTest
     // Add image
     unset($edit);
     $edit = array('title' => $title, 'body' => $description, 'files[image]' => $img_path);
-    $this->drupalPostRequest('node/add/image', $edit, 'Submit');
+    $this->drupalPostRequest('node/add/image', $edit, t('Save'));
     $content = $this->_browser->getContent();
     // test message
-    $this->assertWantedRaw(t('Your %post has been created.', array('%post' => 'Image')), "Checking message");
     
+    $this->assertWantedRaw(t('!post %title has been created.', array('!post' => 'Image', '%title' => $title)), "Checking message");
     // get node nid
     $node = node_load(array('title' => $title));
     $this->drupalGet("node/$node->nid");
     $content = $this->_browser->getContent();
     $this->assertWantedText($title, "Checking title : $title");
-    $this->assertWantedText($description, "Checking body: $description");
     
     // sprawdz czy obrazek jest dobry
     preg_match_all('~<img.*?src="?([^"]*png?)"?[^>]*>~i', $content, $matches);
@@ -105,7 +103,7 @@ class ImageModuleTest extends DrupalTest
     // 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")) {
+      if (strpos(strtolower($file), "testgd")) {
         $size = getimagesize($file);
         if ($size == $my_size) {
           $found = true;
@@ -122,12 +120,10 @@ class ImageModuleTest extends DrupalTest
     $img_path = dirname(__FILE__). '/ImageModuleTest.png'; // powininem byc inny obrazek
     unset($edit);
     $edit = array('title' => $title, 'body' => $description, 'files[image]' => $img_path);
-    $this->drupalPostRequest('node/'. $node->nid .'/edit', $edit, 'Submit' );
+    $this->drupalPostRequest('node/'. $node->nid .'/edit', $edit, t('Save'));
     $content = $this->_browser->getContent();
     $this->drupalGet("node/$node->nid");
     $this->assertWantedText($title, "Checking title : $title");
-    $this->assertWantedText($description, "Checking body: $description");
-
   }
 }
 
