MockPhpStorage.php 717 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace Drupal\system\PhpStorage;
  3. /**
  4. * Mock PHP storage class used for testing.
  5. */
  6. class MockPhpStorage {
  7. /**
  8. * The storage configuration.
  9. *
  10. * @var array
  11. */
  12. protected $configuration;
  13. /**
  14. * Constructs a MockPhpStorage object.
  15. *
  16. * @param array $configuration
  17. */
  18. public function __construct(array $configuration) {
  19. $this->configuration = $configuration;
  20. }
  21. /**
  22. * Gets the configuration data.
  23. */
  24. public function getConfiguration() {
  25. return $this->configuration;
  26. }
  27. /**
  28. * Gets a single configuration key.
  29. */
  30. public function getConfigurationValue($key) {
  31. return isset($this->configuration[$key]) ? $this->configuration[$key] : NULL;
  32. }
  33. }