- Patch #267813 by alpritt: fixed some user module tests.
parent
caa2e7e1d1
commit
76aedbefe0
|
@ -252,6 +252,6 @@ class DrupalReporter extends SimpleReporter {
|
||||||
}
|
}
|
||||||
|
|
||||||
function unit_tests($args, $reporter) {
|
function unit_tests($args, $reporter) {
|
||||||
return $reporter->form['Drupal Unit Tests'];
|
return $reporter->form['Drupal unit tests'];
|
||||||
}
|
}
|
||||||
?>
|
?>
|
|
@ -36,7 +36,7 @@ class DrupalTests extends DrupalTestSuite {
|
||||||
*/
|
*/
|
||||||
function DrupalTests($class_list = NULL) {
|
function DrupalTests($class_list = NULL) {
|
||||||
static $classes;
|
static $classes;
|
||||||
$this->DrupalTestSuite('Drupal Unit Tests');
|
$this->DrupalTestSuite('Drupal unit tests');
|
||||||
|
|
||||||
// Tricky part to avoid double inclusion.
|
// Tricky part to avoid double inclusion.
|
||||||
if (!$classes) {
|
if (!$classes) {
|
||||||
|
|
|
@ -210,9 +210,9 @@ class TextReporter extends SimpleReporter {
|
||||||
print "OK\n";
|
print "OK\n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print "FAILURES!!!\n";
|
print "FAILURES\n";
|
||||||
}
|
}
|
||||||
print "Test cases run: ". $this->getTestCaseProgress() ."/". $this->getTestCaseCount() .", Passes: ". $this->getPassCount() .", Failures: ". $this->getFailCount() .", Exceptions: ". $this->getExceptionCount() ."\n";
|
print "Test cases run: ". $this->getTestCaseProgress() ."/". $this->getTestCaseCount() .", passes: ". $this->getPassCount() .", failures: ". $this->getFailCount() .", exceptions: ". $this->getExceptionCount() ."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -302,7 +302,7 @@ class UserPictureTestCase extends DrupalWebTestCase {
|
||||||
$this->assertText(t('The changes have been saved.'));
|
$this->assertText(t('The changes have been saved.'));
|
||||||
|
|
||||||
// Check if image is displayed in user's profile page.
|
// Check if image is displayed in user's profile page.
|
||||||
$this->assertRaw(file_create_url($picture_url), t("Image is displayed in user's profile page"));
|
$this->assertRaw(file_create_url($picture_path), t("Image is displayed in user's profile page"));
|
||||||
|
|
||||||
// Check if file is located in proper directory.
|
// Check if file is located in proper directory.
|
||||||
$this->assertTrue(is_file($picture_path), t('File is located in proper directory'));
|
$this->assertTrue(is_file($picture_path), t('File is located in proper directory'));
|
||||||
|
@ -405,8 +405,9 @@ class UserPictureTestCase extends DrupalWebTestCase {
|
||||||
$edit = array('files[picture_upload]' => realpath($image->filename));
|
$edit = array('files[picture_upload]' => realpath($image->filename));
|
||||||
$this->drupalPost('user/' . $this->user->uid.'/edit', $edit, t('Save'));
|
$this->drupalPost('user/' . $this->user->uid.'/edit', $edit, t('Save'));
|
||||||
|
|
||||||
|
$img_info = image_get_info($image->filename);
|
||||||
$picture_dir = variable_get('user_picture_path', 'pictures');
|
$picture_dir = variable_get('user_picture_path', 'pictures');
|
||||||
$pic_path = file_directory_path() .'/'.$picture_dir .'/picture-'.$this->user->uid.'.jpg';
|
$pic_path = file_directory_path() . '/' . $picture_dir . '/picture-' . $this->user->uid . '.' . $img_info['extension'];
|
||||||
|
|
||||||
return $pic_path;
|
return $pic_path;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue