Skip to content

Commit

Permalink
Correct field names. D8 backport bug. bracket. Old style arrays.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jen Lampton committed Jan 13, 2021
1 parent bcac48f commit 4005b11
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions tests/googleanalytics.test
Original file line number Diff line number Diff line change
Expand Up @@ -436,21 +436,21 @@ class GoogleAnalyticsCustomDimensionsAndMetricsTest extends BackdropWebTestCase
$ua_code = 'UA-123456-1';

// Check form validation.
$edit['google_analytics_account'] = $ua_code;
$edit['google_analytics_custom_dimension[indexes][1][value]'] = '[current-user:name]';
$edit['google_analytics_custom_dimension[indexes][2][value]'] = '[current-user:edit-url]';
$edit['google_analytics_custom_dimension[indexes][3][value]'] = '[user:name]';
$edit['google_analytics_custom_dimension[indexes][4][value]'] = '[term:name]';
$edit['google_analytics_custom_dimension[indexes][5][value]'] = '[term:tid]';

$this->backdropPostForm('admin/config/system/googleanalytics', $edit, t('Save configuration'));

$this->assertRaw(t('The %element-title is using the following forbidden tokens with personal identifying information: @invalid-tokens.', ['%element-title' => t('Custom dimension value #@index', ['@index' => 1]), '@invalid-tokens' => implode(', ', array('[current-user:name]'))]));
$this->assertRaw(t('The %element-title is using the following forbidden tokens with personal identifying information: @invalid-tokens.', ['%element-title' => t('Custom dimension value #@index', ['@index' => 2]), '@invalid-tokens' => implode(', ', array('[current-user:edit-url]'))]));
$this->assertRaw(t('The %element-title is using the following forbidden tokens with personal identifying information: @invalid-tokens.', ['%element-title' => t('Custom dimension value #@index', ['@index' => 3]), '@invalid-tokens' => implode(', ', array('[user:name]'))]));
$edit['googleanalytics_account'] = $ua_code;
$edit['googleanalytics_custom_dimension[indexes][1][value]'] = '[current-user:name]';
$edit['googleanalytics_custom_dimension[indexes][2][value]'] = '[current-user:edit-url]';
$edit['googleanalytics_custom_dimension[indexes][3][value]'] = '[user:name]';
$edit['googleanalytics_custom_dimension[indexes][4][value]'] = '[term:name]';
$edit['googleanalytics_custom_dimension[indexes][5][value]'] = '[term:tid]';

$this->backdropPost('admin/config/system/googleanalytics', $edit, t('Save configuration'));

$this->assertRaw(t('The %element-title is using the following forbidden tokens with personal identifying information: @invalid-tokens.', array('%element-title' => t('Custom dimension value #@index', array('@index' => 1)), '@invalid-tokens' => implode(', ', array('[current-user:name]')))));
$this->assertRaw(t('The %element-title is using the following forbidden tokens with personal identifying information: @invalid-tokens.', array('%element-title' => t('Custom dimension value #@index', array('@index' => 2)), '@invalid-tokens' => implode(', ', array('[current-user:edit-url]')))));
$this->assertRaw(t('The %element-title is using the following forbidden tokens with personal identifying information: @invalid-tokens.', array('%element-title' => t('Custom dimension value #@index', array('@index' => 3)), '@invalid-tokens' => implode(', ', array('[user:name]')))));
// BUG #2037595
//$this->assertNoRaw(t('The %element-title is using the following forbidden tokens with personal identifying information: @invalid-tokens.', ['%element-title' => t('Custom dimension value #@index', ['@index' => 4]), '@invalid-tokens' => implode(', ', array('[term:name]'))]));
//$this->assertNoRaw(t('The %element-title is using the following forbidden tokens with personal identifying information: @invalid-tokens.', ['%element-title' => t('Custom dimension value #@index', ['@index' => 5]), '@invalid-tokens' => implode(', ', array('[term:tid]'))]));
//$this->assertNoRaw(t('The %element-title is using the following forbidden tokens with personal identifying information: @invalid-tokens.', array('%element-title' => t('Custom dimension value #@index', array('@index' => 4)), '@invalid-tokens' => implode(', ', array('[term:name]')))));
//$this->assertNoRaw(t('The %element-title is using the following forbidden tokens with personal identifying information: @invalid-tokens.', array('%element-title' => t('Custom dimension value #@index', array('@index' => 5)), '@invalid-tokens' => implode(', ', array('[term:tid]')))));
}
}

Expand Down

0 comments on commit 4005b11

Please sign in to comment.