You are here

class DependencySerializationTestDummy in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/DependencyInjection/DependencySerializationTest.php \Drupal\Tests\Core\DependencyInjection\DependencySerializationTestDummy
  2. 10 core/tests/Drupal/Tests/Core/DependencyInjection/DependencySerializationTest.php \Drupal\Tests\Core\DependencyInjection\DependencySerializationTestDummy

Defines a test class which has a single service as dependency.

Hierarchy

Expanded class hierarchy of DependencySerializationTestDummy

File

core/tests/Drupal/Tests/Core/DependencyInjection/DependencySerializationTest.php, line 75
Contains \Drupal\Tests\Core\DependencyInjection\DependencySerializationTest.

Namespace

Drupal\Tests\Core\DependencyInjection
View source
class DependencySerializationTestDummy implements ContainerAwareInterface {
  use DependencySerializationTrait;

  /**
   * A test service.
   *
   * @var \stdClass
   */
  public $service;

  /**
   * The container.
   *
   * @var \Symfony\Component\DependencyInjection\ContainerInterface
   */
  public $container;

  /**
   * Constructs a new TestClass object.
   *
   * @param object $service
   *   A test service.
   */
  public function __construct(\stdClass $service) {
    $this->service = $service;
  }

  /**
   * {@inheritdoc}
   */
  public function setContainer(ContainerInterface $container = NULL) {
    $this->container = $container;
  }

  /**
   * Gets the stored service IDs.
   */
  public function getServiceIds() {
    return $this->_serviceIds;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DependencySerializationTestDummy::$container public property The container.
DependencySerializationTestDummy::$service public property A test service.
DependencySerializationTestDummy::getServiceIds public function Gets the stored service IDs.
DependencySerializationTestDummy::setContainer public function Sets the Container.
DependencySerializationTestDummy::__construct public function Constructs a new TestClass object.
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2