MockTestConnection.php

Same filename and directory in other branches
  1. 9 core/modules/system/tests/src/Functional/FileTransfer/MockTestConnection.php
  2. 8.9.x core/modules/system/tests/src/Functional/FileTransfer/MockTestConnection.php
  3. 10 core/modules/system/tests/src/Functional/FileTransfer/MockTestConnection.php

Namespace

Drupal\Tests\system\Functional\FileTransfer

File

core/modules/system/tests/src/Functional/FileTransfer/MockTestConnection.php

View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\system\Functional\FileTransfer;


/**
 * Mock connection object for test case.
 */
class MockTestConnection {
  
  /**
   * The commands to run.
   *
   * @var array
   */
  protected $commandsRun = [];
  
  /**
   * The database connection.
   *
   * @var string
   */
  public $connectionString;
  
  /**
   * Executes a command and stores it in the command history.
   */
  public function run($cmd) {
    $this->commandsRun[] = $cmd;
  }
  
  /**
   * Retrieves and clears the command history.
   */
  public function flushCommands() {
    $out = $this->commandsRun;
    $this->commandsRun = [];
    return $out;
  }

}

Classes

Title Deprecated Summary
MockTestConnection Mock connection object for test case.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.