class DbConnectionsTest in Auth0 Single Sign On 8.2
Hierarchy
- class \Auth0\Tests\API\ApiTests extends \Auth0\Tests\API\PHPUnit_Framework_TestCase uses ErrorHelpers
- class \Auth0\Tests\API\Authentication\DbConnectionsTest
Expanded class hierarchy of DbConnectionsTest
File
- vendor/
auth0/ auth0-php/ tests/ API/ Authentication/ DbConnectionsTest.php, line 7
Namespace
Auth0\Tests\API\AuthenticationView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ApiTests:: |
protected static | property | Environment variables. | |
ApiTests:: |
protected static | function | Get all test suite environment variables. | |
DbConnectionsTest:: |
protected | property | ||
DbConnectionsTest:: |
protected | property | ||
DbConnectionsTest:: |
protected | function | ||
DbConnectionsTest:: |
public | function | ||
DbConnectionsTest:: |
public | function | ||
ErrorHelpers:: |
protected | function | Does an error message contain a specific string? |