You are here

public function PatternsImportTestCase::testImportFileFromURL in Patterns 7

Same name and namespace in other branches
  1. 7.2 tests/importing/importing.test \PatternsImportTestCase::testImportFileFromURL()

File

tests/importing/importing.test, line 71
Tests importing files.

Class

PatternsImportTestCase
@file Tests importing files.

Code

public function testImportFileFromURL() {
  $name = 'Test_Import_From_URL';
  $destination = patterns_path_get_files_dir();
  if (!$this
    ->isFopenurlEnabled()) {
    $this
      ->pass(t('Import from URL test skipped because \'allow_url_fopen\' is disabled.'));
    return;
  }

  // Fill the form.
  $edit = array();
  $edit['name'] = $name;
  $edit['pattern_uri'] = self::REMOTE_URL_IMPORT;
  $edit['destination'] = $destination;

  // Post the form.
  $this
    ->drupalPost('admin/patterns/import/url', $edit, t('Import'));
  $this
    ->checkImportedFile($name, PATTERNS_FORMAT_YAML, $destination);
}