You are here

public function CacheFlushUICRUD::createTestEntitys in CacheFlush 7.3

Create cacheflush test entities.

1 call to CacheFlushUICRUD::createTestEntitys()
CacheFlushUICRUD::testAdminPage in modules/cacheflush_ui/cacheflush_ui.test
Tests List page.

File

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

Class

CacheFlushUICRUD
Test the UI CRUD.

Code

public function createTestEntitys() {
  $entity = entity_create('cacheflush', array(
    'title' => 'Test-Entity-Enabled',
    'status' => 1,
    'menu' => 0,
    'uid' => $this->loggedInUser->uid,
  ));
  $entity
    ->save();
  $entity = entity_create('cacheflush', array(
    'title' => 'Test-Entity-Disabled',
    'status' => 0,
    'menu' => 1,
    'uid' => $this->loggedInUser->uid,
  ));
  $entity
    ->save();
  $entities = array_values(cacheflush_load_multiple(FALSE));
  $this
    ->assertEqual($entities[0]->title, 'Test-Entity-Enabled', 'Entity successfully created.');
  $this
    ->assertEqual($entities[1]->title, 'Test-Entity-Disabled', 'Entity successfully created.');

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