You are here

public function UsersMockedTest::testThatExceptionIsThrownWhenSmsConnectionHasNoPhoneNumber in Auth0 Single Sign On 8.2

File

vendor/auth0/auth0-php/tests/API/Management/UsersMockedTest.php, line 129

Class

UsersMockedTest
Class UsersMockedTest.

Namespace

Auth0\Tests\API\Management

Code

public function testThatExceptionIsThrownWhenSmsConnectionHasNoPhoneNumber() {
  $api = new Management(uniqid(), uniqid());
  try {
    $api
      ->users()
      ->create([
      'connection' => 'sms',
    ]);
    $exception_message = '';
  } catch (\Exception $e) {
    $exception_message = $e
      ->getMessage();
  }
  $this
    ->assertContains('Missing required "phone_number" field for sms connection', $exception_message);
}