You are here

public function VarnishTestCase::assertVarnishCommand in Varnish 7

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

Run a varnish command and make sure it worked for us.

Parameters

string $cmds: The command to execute.

3 calls to VarnishTestCase::assertVarnishCommand()
VarnishConnectionTestCase::testMultipleCommands in ./varnish.test
VarnishConnectionTestCase::testVarnishStats in ./varnish.test
VarnishConnectionTestCase::testVarnishStatus in ./varnish.test

File

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

Class

VarnishTestCase
Base class for Varnish Test Cases.

Code

public function assertVarnishCommand($cmds) {
  $statuses = _varnish_terminal_run($cmds);
  foreach ($statuses as $terminal => $commands) {
    foreach ($commands as $command => $status) {
      $this
        ->assertEqual($status['code'], '200', t('Command: %command
          was executed properly.', array(
        '%command' => $command,
      )));
    }
  }
}