You are here

class FakeCollection in Lightweight Directory Access Protocol (LDAP) 8.4

Simulate the collection response.

Hierarchy

  • class \Drupal\ldap_servers_dummy\FakeCollection implements \Symfony\Component\Ldap\Adapter\CollectionInterface

Expanded class hierarchy of FakeCollection

1 file declares its use of FakeCollection
LoginTest.php in ldap_authentication/tests/src/Kernel/LoginTest.php

File

ldap_servers/tests/modules/ldap_servers_dummy/src/FakeCollection.php, line 13

Namespace

Drupal\ldap_servers_dummy
View source
class FakeCollection implements CollectionInterface {

  /**
   * Result.
   *
   * @var \ArrayObject
   */
  protected $result;

  /**
   * New FakeCollection.
   *
   * @param \Symfony\Component\Ldap\Entry[] $result
   *   Entries.
   */
  public function __construct(array $result) {
    $this->result = new \ArrayObject($result);
  }

  /**
   * {@inheritdoc}
   */
  public function toArray() : array {
    return (array) $this->result;
  }

  /**
   * {@inheritdoc}
   */
  public function getIterator() {
    return $this->result
      ->getIterator();
  }

  /**
   * {@inheritdoc}
   */
  public function offsetExists($offset) : bool {
    return $this->result
      ->offsetExists($offset);
  }

  /**
   * {@inheritdoc}
   */
  public function offsetGet($offset) {
    return $this->result
      ->offsetGet($offset);
  }

  /**
   * {@inheritdoc}
   */
  public function offsetSet($offset, $value) : void {
    $this->result
      ->offsetSet($offset, $value);
  }

  /**
   * {@inheritdoc}
   */
  public function offsetUnset($offset) : void {
    $this->result
      ->offsetUnset($offset);
  }

  /**
   * {@inheritdoc}
   */
  public function count() : int {
    return $this->result
      ->count();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FakeCollection::$result protected property Result.
FakeCollection::count public function
FakeCollection::getIterator public function
FakeCollection::offsetExists public function
FakeCollection::offsetGet public function
FakeCollection::offsetSet public function
FakeCollection::offsetUnset public function
FakeCollection::toArray public function
FakeCollection::__construct public function New FakeCollection.