You are here

public function AuthcacheP13nTestMarkup::testAddSettings in Authenticated User Page Caching (Authcache) 7.2

Cover authcache_p13n_add_setting() and authcache_p13n_get_settings().

File

modules/authcache_p13n/tests/authcache_p13n.markup.test, line 309
Define tests for markup substitution.

Class

AuthcacheP13nTestMarkup
Tests for markup substitution.

Code

public function testAddSettings() {
  authcache_p13n_add_setting(array(
    '#setting' => 'some-setting',
    '#param' => array(
      'some' => 'param',
    ),
  ));
  authcache_p13n_add_setting(array(
    '#setting' => 'some-setting',
    '#param' => array(
      'other' => 'stuff',
    ),
  ));
  authcache_p13n_add_setting(array(
    '#setting' => 'other-setting',
  ));
  authcache_p13n_add_setting(array(
    '#setting' => 'some-setting',
    '#param' => array(
      'other' => 'later-overrides-former',
    ),
  ));
  $expect = array(
    'some-setting' => array(
      '#setting' => 'some-setting',
      '#param' => array(
        'some' => 'param',
        'other' => 'later-overrides-former',
      ),
    ),
    'other-setting' => array(
      '#setting' => 'other-setting',
    ),
  );
  $result = authcache_p13n_get_settings();
  $this
    ->assertEqual($expect, $result);
}