You are here

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

Cover authcache_p13n_add_partial(), authcache_p13n_get_assemblies().

File

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

Class

AuthcacheP13nTestMarkup
Tests for markup substitution.

Code

public function testAddPartial() {
  authcache_p13n_add_partial('some-asm', 'part1', 'arg1');
  authcache_p13n_add_partial('some-asm', 'part1', 'arg2');
  authcache_p13n_add_partial('some-asm', 'part2', 'x');
  authcache_p13n_add_partial('some-asm', 'part2', 'y');
  authcache_p13n_add_partial('other-asm', 'p', 'z');
  $expect = array(
    'some-asm' => array(
      'part1' => array(
        'arg1',
        'arg2',
      ),
      'part2' => array(
        'x',
        'y',
      ),
    ),
    'other-asm' => array(
      'p' => array(
        'z',
      ),
    ),
  );
  $result = authcache_p13n_get_assemblies();
  $this
    ->assertEqual($expect, $result);
}