You are here

public function ExifOrientationTest::setUp in EXIF Orientation 8

Same name and namespace in other branches
  1. 7 tests/exif_orientation.test \ExifOrientationTest::setUp()

File

tests/exif_orientation.test, line 19
Tests for exif_orientation.module.

Class

ExifOrientationTest
@file Tests for exif_orientation.module.

Code

public function setUp() {
  $modules = array(
    'image',
    'exif_orientation',
  );
  parent::setUp($modules);

  // Set to high quality because we don't want encoding artifacts.
  variable_set('image_jpeg_quality', 98);

  // Code from UserPictureTestCase:
  // Enable user pictures.
  variable_set('user_pictures', 1);

  // Test if directories specified in settings exist in filesystem.
  $file_dir = 'public://';
  $file_check = file_prepare_directory($file_dir, FILE_CREATE_DIRECTORY);
  $picture_dir = variable_get('user_picture_path', 'pictures');
  $picture_path = $file_dir . $picture_dir;
  $pic_check = file_prepare_directory($picture_path, FILE_CREATE_DIRECTORY);
  $this->_directory_test = is_writable($picture_path);
  $this
    ->assertTrue($this->_directory_test, "The directory {$picture_path} doesn't exist or is not writable. Further tests won't be made.");
}