1 views_ui.test ViewsUIWizardJumpMenuTestCase::createFileAndGetPath()

Helper function to create a file and return its expected path.

File

core/modules/views/tests/views_ui.test, line 711
Tests Views UI Wizard.

Class

ViewsUIWizardJumpMenuTestCase
Tests the ability of the views wizard to create views with a jump menu style plugin.

Code

function createFileAndGetPath() {
  $file = entity_create('file', array(
    'uid' => 1,
    'filename' => 'views-ui-jump-menu-test.txt',
    'uri' => 'public://views-ui-jump-menu-test.txt',
    'filemime' => 'text/plain',
    'timestamp' => 1,
    'status' => FILE_STATUS_PERMANENT,
  ));
  file_put_contents($file->uri, 'test content');
  $file->save();
  return file_create_url($file->uri);
}