You are here

function VarnishTestCase::assertVarnishCommand in Varnish 6

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

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

Parameters

string $cmd 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 129
Tests the basic functionality of Varnish.

Class

VarnishTestCase
Base class for Varnish Test Cases.

Code

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,
      )));
    }
  }
}