public function CasPropertyBagTest::testGetAttributes in CAS 2.x
Same name and namespace in other branches
- 8 tests/src/Unit/CasPropertyBagTest.php \Drupal\Tests\cas\Unit\CasPropertyBagTest::testGetAttributes()
Test getting the attributes.
@covers ::getAttributes
File
- tests/
src/ Unit/ CasPropertyBagTest.php, line 108
Class
- CasPropertyBagTest
- CasPropertyBag unit tests.
Namespace
Drupal\Tests\cas\UnitCode
public function testGetAttributes() {
$bag = new CasPropertyBag($this
->randomMachineName(8));
$reflection = new \ReflectionClass($bag);
$property = $reflection
->getProperty('attributes');
$property
->setAccessible(TRUE);
$attributes = [
'foo' => [
'bar',
],
'baz' => [
'quux',
'foobar',
],
];
$property
->setValue($bag, $attributes);
$this
->assertEquals($attributes, $bag
->getAttributes());
}