You are here

class MockCollection in MongoDB 7

Hierarchy

Expanded class hierarchy of MockCollection

File

mongodb_cache/src/Tests/CacheUnitTestCase.php, line 19

Namespace

Drupal\mongodb_cache\Tests
View source
class MockCollection {

  // @codingStandardsIgnoreEnd

  /**
   * The exception message to be thrown.
   *
   * @var string
   */
  protected $message;

  /**
   * MockCollection constructor.
   *
   * @param string $message
   *   The exception message to be thrown.
   */
  public function __construct($message) {
    $this->message = $message;
  }

  /**
   * Always fail, as needed for issue #2974216.
   *
   * @throws \MongoException
   */
  public function save() {
    throw new \MongoException($this->message);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MockCollection::$message protected property The exception message to be thrown.
MockCollection::save public function Always fail, as needed for issue #2974216.
MockCollection::__construct public function MockCollection constructor.