You are here

public function VarnishAdminTestCase::testVarnishSettingsPage in Varnish 7

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

File

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

Class

VarnishAdminTestCase
Tests Varnish Administration.

Code

public function testVarnishSettingsPage() {
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->drupalGet('admin/config/development/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/config/development/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.'));
}