You are here

function VarnishAdminTestCase::testVarnishSettingsPage in Varnish 6

Same name and namespace in other branches
  1. 7 varnish.test \VarnishAdminTestCase::testVarnishSettingsPage()

File

./varnish.test, line 351
Tests the basic functionality of Varnish.

Class

VarnishAdminTestCase

Code

function testVarnishSettingsPage() {
  $this
    ->drupalLogin($this->admin_user);
  $this
    ->drupalGet('admin/settings/varnish');
  $values = $this
    ->_getVarnishSettingsValues();

  // Try to set the timeout value to something else than a numeric value.
  // This should result in an error.
  $values['varnish_socket_timeout'] = 'asdf';
  $this
    ->drupalPost('admin/settings/varnish', $values, t('Save configuration'));
  $this
    ->assertText(t('Varnish connection timeout must be a positive number.'), t('Error message was given trying to set timeout to a string.'));
}