You are here

class DbConnectionsTest in Auth0 Single Sign On 8.2

Hierarchy

Expanded class hierarchy of DbConnectionsTest

File

vendor/auth0/auth0-php/tests/API/Authentication/DbConnectionsTest.php, line 7

Namespace

Auth0\Tests\API\Authentication
View source
class DbConnectionsTest extends ApiTests {
  protected $email;
  protected $connection = 'Username-Password-Authentication';
  protected function setUp() {
    $this->email = 'test-dbconnections-user' . rand() . '@test.com';
  }
  public function testSignup() {
    $env = self::getEnv();
    $api = new Authentication($env['DOMAIN'], $env['APP_CLIENT_ID']);
    $email = $this->email;
    $password = 'Bqn8LEsu68p38TmFvsWW';
    $connection = $this->connection;
    $response = $api
      ->dbconnections_signup($email, $password, $connection);
    $this
      ->assertArrayHasKey('_id', $response);
    $this
      ->assertArrayHasKey('email_verified', $response);
    $this
      ->assertArrayHasKey('email', $response);
    $this
      ->assertEquals($email, $response['email']);
  }
  public function testChangePassword() {
    $env = self::getEnv();
    $api = new Authentication($env['DOMAIN'], $env['APP_CLIENT_ID']);
    $email = $this->email;
    $connection = $this->connection;
    $response = $api
      ->dbconnections_change_password($email, $connection);
    $this
      ->assertNotEmpty($response);
    $this
      ->assertContains('email', $response);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ApiTests::$env protected static property Environment variables.
ApiTests::getEnv protected static function Get all test suite environment variables.
DbConnectionsTest::$connection protected property
DbConnectionsTest::$email protected property
DbConnectionsTest::setUp protected function
DbConnectionsTest::testChangePassword public function
DbConnectionsTest::testSignup public function
ErrorHelpers::errorHasString protected function Does an error message contain a specific string?