private function OtherEventVariablesTest::assertAbstractEventVariables in Hook Event Dispatcher 8.2
Same name and namespace in other branches
- 3.x modules/preprocess_event_dispatcher/tests/src/Unit/OtherEventVariablesTest.php \Drupal\Tests\preprocess_event_dispatcher\Unit\OtherEventVariablesTest::assertAbstractEventVariables()
Test the default event variable functions.
Parameters
\Drupal\preprocess_event_dispatcher\Variables\AbstractEventVariables $variables: Variables object.
12 calls to OtherEventVariablesTest::assertAbstractEventVariables()
- OtherEventVariablesTest::testBlockEvent in modules/
preprocess_event_dispatcher/ tests/ src/ Unit/ OtherEventVariablesTest.php - Test a BlockPreprocessEvent.
- OtherEventVariablesTest::testBlockEventWithBlockContent in modules/
preprocess_event_dispatcher/ tests/ src/ Unit/ OtherEventVariablesTest.php - Test a BlockPreprocessEvent with block content entity.
- OtherEventVariablesTest::testFieldEvent in modules/
preprocess_event_dispatcher/ tests/ src/ Unit/ OtherEventVariablesTest.php - Test a FieldPreprocessEvent.
- OtherEventVariablesTest::testFormEvent in modules/
preprocess_event_dispatcher/ tests/ src/ Unit/ OtherEventVariablesTest.php - Test FormPreprocessEvent.
- OtherEventVariablesTest::testHtmlEvent in modules/
preprocess_event_dispatcher/ tests/ src/ Unit/ OtherEventVariablesTest.php - Test a HtmlPreprocessEvent.
File
- modules/
preprocess_event_dispatcher/ tests/ src/ Unit/ OtherEventVariablesTest.php, line 269
Class
- OtherEventVariablesTest
- Class OtherEventVariablesTest.
Namespace
Drupal\Tests\preprocess_event_dispatcher\UnitCode
private function assertAbstractEventVariables(AbstractEventVariables $variables) : void {
self::assertSame('success', $variables
->get('test'));
self::assertSame('default', $variables
->get('test2', 'default'));
$reference =& $variables
->getByReference('reference');
self::assertSame('first', $reference);
$reference = 'second';
self::assertSame('second', $variables
->get('reference'));
$variables
->set('test3', 'new set');
self::assertSame('new set', $variables
->get('test3'));
$variables
->remove('test');
self::assertNull($variables
->get('test'));
}