You are here

public function CasPropertyBagTest::testGetAttributes in CAS 8

Same name and namespace in other branches
  1. 2.x 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\Unit

Code

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());
}