class TestClass in Zircon Profile 8
Same name in this branch
- 8 vendor/sebastian/comparator/tests/_files/TestClass.php \SebastianBergmann\Comparator\TestClass
- 8 vendor/phpunit/php-token-stream/tests/_fixture/classInNamespace.php \Foo\Bar\TestClass
- 8 vendor/phpunit/php-token-stream/tests/_fixture/classInScopedNamespace.php \Foo\BarScoped\TestClass
- 8 vendor/phpunit/php-token-stream/tests/_fixture/issue19.php \TestClass
- 8 core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php \Drupal\Tests\Core\TypedData\TestClass
- 8 core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php \Drupal\Tests\Component\Utility\TestClass
- 8 core/modules/simpletest/tests/src/Unit/AssertContentTraitTest.php \Drupal\Tests\simpletest\Unit\TestClass
- 8 core/modules/system/tests/modules/service_provider_test/src/TestClass.php \Drupal\service_provider_test\TestClass
- 8 vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/annotation/TestClass.php \Doctrine\TestClass
Same name and namespace in other branches
- 8.0 core/modules/system/tests/modules/service_provider_test/src/TestClass.php \Drupal\service_provider_test\TestClass
Hierarchy
- class \Drupal\service_provider_test\TestClass implements DestructableInterface, ContainerAwareInterface, EventSubscriberInterface uses ContainerAwareTrait
Expanded class hierarchy of TestClass
3 string references to 'TestClass'
- ErrorTest::providerTestFormatBacktrace in core/
tests/ Drupal/ Tests/ Core/ Utility/ ErrorTest.php - Data provider for testFormatBacktrace.
- ErrorTest::providerTestGetLastCaller in core/
tests/ Drupal/ Tests/ Core/ Utility/ ErrorTest.php - Data provider for testGetLastCaller.
- service_provider_test.services.yml in core/
modules/ system/ tests/ modules/ service_provider_test/ service_provider_test.services.yml - core/modules/system/tests/modules/service_provider_test/service_provider_test.services.yml
1 service uses TestClass
- service_provider_test_class in core/
modules/ system/ tests/ modules/ service_provider_test/ service_provider_test.services.yml - Drupal\service_provider_test\TestClass
File
- core/
modules/ system/ tests/ modules/ service_provider_test/ src/ TestClass.php, line 19 - Contains \Drupal\service_provider_test\TestClass.
Namespace
Drupal\service_provider_testView source
class TestClass implements EventSubscriberInterface, DestructableInterface, ContainerAwareInterface {
use ContainerAwareTrait;
/**
* The state keyvalue collection.
*
* @var \Drupal\Core\State\StateInterface
*/
protected $state;
/**
* Constructor.
*
* @param \Drupal\Core\State\StateInterface $state
* The state key value store.
*/
public function __construct(StateInterface $state) {
$this->state = $state;
}
/**
* A simple kernel listener method.
*/
public function onKernelRequestTest(GetResponseEvent $event) {
drupal_set_message(t('The service_provider_test event subscriber fired!'));
}
/**
* Flags the response in case a rebuild indicator is used.
*/
public function onKernelResponseTest(FilterResponseEvent $event) {
if ($this->container
->hasParameter('container_rebuild_indicator')) {
$event
->getResponse()->headers
->set('container_rebuild_indicator', $this->container
->getParameter('container_rebuild_indicator'));
}
if ($this->container
->hasParameter('container_rebuild_test_parameter')) {
$event
->getResponse()->headers
->set('container_rebuild_test_parameter', $this->container
->getParameter('container_rebuild_test_parameter'));
}
}
/**
* Registers methods as kernel listeners.
*
* @return array
* An array of event listener definitions.
*/
static function getSubscribedEvents() {
$events[KernelEvents::REQUEST][] = array(
'onKernelRequestTest',
);
$events[KernelEvents::RESPONSE][] = array(
'onKernelResponseTest',
);
return $events;
}
/**
* {@inheritdoc}
*/
public function destruct() {
$this->state
->set('service_provider_test.destructed', TRUE);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ContainerAwareTrait:: |
protected | property | ||
ContainerAwareTrait:: |
public | function | Sets the Container associated with this Controller. | |
TestClass:: |
protected | property | The state keyvalue collection. | |
TestClass:: |
public | function |
Performs destruct operations. Overrides DestructableInterface:: |
|
TestClass:: |
static | function |
Registers methods as kernel listeners. Overrides EventSubscriberInterface:: |
|
TestClass:: |
public | function | A simple kernel listener method. | |
TestClass:: |
public | function | Flags the response in case a rebuild indicator is used. | |
TestClass:: |
public | function | Constructor. |