1 path_pattern.test PathPatternTokenTestCase::testPathPatternTokens()

File

core/modules/path/tests/path_pattern.test, line 1068
Functionality tests for automatic path generation.

Class

PathPatternTokenTestCase
Token functionality tests.

Code

function testPathPatternTokens() {
  $array = array(
    'test first arg',
    'The Array / value',
  );

  $tokens = array(
    'join-path' => 'test-first-arg/the-array-value',
  );
  $data['array'] = $array;
  $replacements = $this->assertTokens('array', $data, $tokens);

  // Ensure that the path_clean_token_values() function does not alter
  // this token value.
  module_load_include('inc', 'path');
  path_clean_token_values($replacements, $data, array());
  $this->assertEqual($replacements['[array:join-path]'], 'test-first-arg/the-array-value');
}