You are here

public function CasRedirectDataTest::testParameters in CAS 8

Same name and namespace in other branches
  1. 2.x tests/src/Unit/CasRedirectDataTest.php \Drupal\Tests\cas\Unit\CasRedirectDataTest::testParameters()

Test the access methods.

@covers ::setParameter @covers ::getParameter @covers ::getAllParameters

File

tests/src/Unit/CasRedirectDataTest.php, line 26

Class

CasRedirectDataTest
CasRedirectData unit tests.

Namespace

Drupal\Tests\cas\Unit

Code

public function testParameters() {

  // Set the base login uri.
  $data = new CasRedirectData();

  // Test gateway set.
  $data
    ->setParameter('gateway', 'true');
  $parms = $data
    ->getAllParameters();
  $this
    ->assertEquals('true', $parms['gateway']);

  // Test gateway removal.
  $data
    ->setParameter('gateway', NULL);
  $parms = $data
    ->getAllParameters();
  $this
    ->assertArrayNotHasKey('gateway', $parms, 'Setvalues of null clear parmaters');
}