You are here

function EsiBlockTest::testAdminBlockConfigureSubmit in ESI: Edge Side Includes 7.3

Test that saving the page will correctly configure the block in the DB.

File

modules/esi_block/esi_block.test, line 51
Tests for the ESI Block module.

Class

EsiBlockTest
Test the node_load_multiple() function.

Code

function testAdminBlockConfigureSubmit() {

  // Get the block-configuration page for the system:help block.
  $this
    ->drupalGet('admin/structure/block/manage/system/help/configure');
  $esi_config = array(
    'esi_enabled' => 1,
    'esi_ttl' => 86400,
  );
  $this
    ->drupalPost('admin/structure/block/manage/system/help/configure', $esi_config, t('Save block'));
  $esi_settings_in_db = db_query("SELECT esi_enabled, esi_ttl FROM {block} WHERE module = :module AND delta = :delta", array(
    ':module' => 'system',
    ':delta' => 'help',
  ))
    ->fetchObject();
  $this
    ->assertEqual($esi_settings_in_db->esi_enabled, TRUE, t('ESI is correctly enabled in the database.'));
  $this
    ->assertEqual($esi_settings_in_db->esi_ttl, 86400, t('ESI TTL is correctly set to 350 in the database.'));
}