You are here

public function CacheFlushUICRUDAccessTest::createTestEntitys in CacheFlush 7.3

Create cacheflush test entities.

1 call to CacheFlushUICRUDAccessTest::createTestEntitys()
CacheFlushUICRUDAccessTest::setUp in modules/cacheflush_ui/cacheflush_ui.test
Sets up the test.

File

modules/cacheflush_ui/cacheflush_ui.test, line 469
Contains test suite for cacheflush ui module.

Class

CacheFlushUICRUDAccessTest
Defines a test for cacheflush ui module CRUD access.

Code

public function createTestEntitys() {
  $options = _cacheflush_get_option_list();
  $data = array();
  $data['cache']['functions'] = $options['cache']['functions'];
  $data['cache_menu']['functions'] = $options['cache_menu']['functions'];
  $data['css']['functions'] = $options['css']['functions'];
  $data = serialize($data);
  $entity = entity_create('cacheflush', array(
    'title' => 'LoggedUserEntity',
    'status' => 1,
    'menu' => 1,
    'data' => $data,
    'uid' => $this->logged_user->uid,
  ));
  $entity
    ->save();
  $entity = entity_create('cacheflush', array(
    'title' => 'AdminUserEntity',
    'status' => 1,
    'menu' => 1,
    'data' => $data,
    'uid' => $this->admin_user->uid,
  ));
  $entity
    ->save();
  $entity = entity_create('cacheflush', array(
    'title' => 'InterfaceUserEntity',
    'status' => 1,
    'menu' => 1,
    'data' => $data,
    'uid' => $this->interface_user->uid,
  ));
  $entity
    ->save();
  $entity = entity_create('cacheflush', array(
    'title' => 'InterfaceUser2Entity',
    'status' => 1,
    'menu' => 1,
    'data' => $data,
    'uid' => $this->interface_user2->uid,
  ));
  $entity
    ->save();

  // Clear menu cache to rebuild the Cacheflush clear menus.
  menu_rebuild();
}