You are here

protected function FileEntityPathsHelper::generateRandomConfig in File Entity Paths 7.2

Create random configuration object based on file_path and file_name.

Parameters

$file_path:

$file_name:

Return value

object

1 call to FileEntityPathsHelper::generateRandomConfig()
FileEntityPathsConfigurationPageTestCase::setUp in tests/fe_paths.test
Sets up a Drupal site for running functional and integration tests.

File

tests/fe_paths.test, line 91
Tests for File Entity Paths

Class

FileEntityPathsHelper
@file Tests for File Entity Paths

Code

protected function generateRandomConfig($file_path, $file_name, $weight = 0) {
  return (object) array(
    'machine_name' => strtolower($this
      ->randomName(8)),
    'label' => $this
      ->randomString(8),
    'path' => $file_path,
    'filename' => $file_name,
    'status' => TRUE,
    'weight' => $weight,
    // @todo: figure out better data handling.
    'data' => array(
      'transliteration' => 0,
      'pathauto' => 0,
      'file_entity' => array(
        'application' => 0,
        'audio' => 0,
        'image' => 'image',
        'video' => 0,
        'default' => 0,
        'text' => 'text',
      ),
      'entity' => 'node',
      'bundle' => array(
        'fe_paths_test_1' => array(),
        'fe_paths_test_2' => array(),
      ),
    ),
    'other_config' => 0,
    'override_options' => 0,
  );
}