public function PageTest::testGetRootVariablesByReference in Hook Event Dispatcher 3.x
Same name and namespace in other branches
- 8.2 modules/preprocess_event_dispatcher/tests/src/Unit/PageTest.php \Drupal\Tests\preprocess_event_dispatcher\Unit\PageTest::testGetRootVariablesByReference()
Test getting root variables by reference.
File
- modules/
preprocess_event_dispatcher/ tests/ src/ Unit/ PageTest.php, line 106
Class
- PageTest
- Class PageTest.
Namespace
Drupal\Tests\preprocess_event_dispatcher\UnitCode
public function testGetRootVariablesByReference() : void {
$vars = [];
$vars['test'] = 'something';
$page = new PageEventVariables($vars);
$retrievedVars =& $page
->getRootVariablesByReference();
self::assertSame($vars, $retrievedVars);
$retrievedVars['test2'] = 'other';
self::assertSame($vars, $retrievedVars);
self::assertSame($vars, $page
->getRootVariablesByReference());
}