You are here

public static function EmailTemplatesTest::setUpBeforeClass in Auth0 Single Sign On 8.2

Test fixture for class

Throws

\Exception

File

vendor/auth0/auth0-php/tests/API/Management/EmailTemplatesTest.php, line 75

Class

EmailTemplatesTest
Class EmailTemplatesTest

Namespace

Auth0\Tests\API\Management

Code

public static function setUpBeforeClass() {
  $env = self::getEnv();
  self::$domain = $env['DOMAIN'];
  self::$token = self::getToken($env, [
    'email_templates' => [
      'actions' => [
        'create',
        'read',
        'update',
      ],
    ],
    'email_provider' => [
      'actions' => [
        'read',
      ],
    ],
  ]);
  self::$api = new Management(self::$token, self::$domain);
  try {

    // Try to get the email template specified.
    self::$gotEmail = self::$api->emailTemplates
      ->get(self::EMAIL_TEMPLATE_NAME);
  } catch (ClientException $e) {
    self::$setUpEmailError = $e
      ->getCode();
    if (404 === self::$setUpEmailError) {

      // Could not find the email template so it can/must be created
      self::$mustCreate = true;
    }
  }
}