You are here

class DummyStateHandlerTest in Auth0 Single Sign On 8.2

Class DummyStateHandlerTest

@package Auth0\Tests\Api\Helpers\State

Hierarchy

  • class \Auth0\Tests\Api\Helpers\State\DummyStateHandlerTest extends \Auth0\Tests\Api\Helpers\State\PHPUnit_Framework_TestCase

Expanded class hierarchy of DummyStateHandlerTest

File

vendor/auth0/auth0-php/tests/API/Helpers/State/DummyStateHandlerTest.php, line 11

Namespace

Auth0\Tests\Api\Helpers\State
View source
class DummyStateHandlerTest extends \PHPUnit_Framework_TestCase {

  /**
   * State handler to use.
   *
   * @var DummyStateHandler
   */
  private $state;

  /**
   * DummyStateHandlerTest constructor.
   */
  public function __construct() {
    parent::__construct();
    $this->state = new DummyStateHandler();
  }

  /**
   * Test that the state issued is null.
   */
  public function testStateIssuedCorrectly() {
    $this
      ->assertNull($this->state
      ->issue());
  }

  /**
   * Test that state always validates to true.
   *
   * @throws \Exception
   */
  public function testStateValidatesCorrectly() {
    $this
      ->assertTrue($this->state
      ->validate(uniqid()));

    // Test again with a different value.
    $this
      ->assertTrue($this->state
      ->validate(uniqid()));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DummyStateHandlerTest::$state private property State handler to use.
DummyStateHandlerTest::testStateIssuedCorrectly public function Test that the state issued is null.
DummyStateHandlerTest::testStateValidatesCorrectly public function Test that state always validates to true.
DummyStateHandlerTest::__construct public function DummyStateHandlerTest constructor.