You are here

public function PatternsImportTestCase::testImportFileFromSource in Patterns 7

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

File

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

Class

PatternsImportTestCase
@file Tests importing files.

Code

public function testImportFileFromSource() {
  $name = 'Test_Import_From_Source';
  $destination = patterns_path_get_files_dir();

  // Fill the form.
  $edit = array();
  $edit['name'] = $name;
  $edit['content'] = $this
    ->loadPattern('importing.yaml', $this->importing_tests_dir);
  $edit['destination'] = $destination;
  $edit['format'] = PATTERNS_FORMAT_YAML;

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