You are here

function PathautoTestHelper::assertEntityPattern in Pathauto 6

Same name and namespace in other branches
  1. 6.2 pathauto.test \PathautoTestHelper::assertEntityPattern()
  2. 7 pathauto.test \PathautoTestHelper::assertEntityPattern()
1 call to PathautoTestHelper::assertEntityPattern()
PathautoUnitTestCase::testEntityBundleRenamingDeleting in ./pathauto.test

File

./pathauto.test, line 191
Functionality tests for Pathauto.

Class

PathautoTestHelper
Helper test class with some added functions for testing.

Code

function assertEntityPattern($entity_type, $bundle, $language = '', $expected) {
  $this
    ->refreshVariables();
  $variables = array(
    "pathauto_{$entity_type}_{$bundle}_{$language}_pattern",
    "pathauto_{$entity_type}_{$bundle}_pattern",
    "pathauto_{$entity_type}_pattern",
  );
  $pattern = '';
  foreach ($variables as $variable) {
    if ($pattern = variable_get($variable, '')) {
      break;
    }
  }
  $this
    ->assertIdentical($expected, $pattern);
}