You are here

protected function CaptchaAdminTest::getCaptchaPointSettingFromDatabase in CAPTCHA 8

Helper function to get CAPTCHA point setting straight from the database.

Parameters

string $form_id: Form machine ID.

Return value

\Drupal\captcha\Entity\CaptchaPoint CaptchaPoint with mysql query result.

2 calls to CaptchaAdminTest::getCaptchaPointSettingFromDatabase()
CaptchaAdminTest::testCaptchaPointAdministration in tests/src/Functional/CaptchaAdminTest.php
Method for testing the CAPTCHA point administration.
CaptchaAdminTest::testCaptchaPointAdministrationByNonAdmin in tests/src/Functional/CaptchaAdminTest.php
Method for testing the CAPTCHA point administration.

File

tests/src/Functional/CaptchaAdminTest.php, line 271

Class

CaptchaAdminTest
Tests CAPTCHA admin settings.

Namespace

Drupal\Tests\captcha\Functional

Code

protected function getCaptchaPointSettingFromDatabase($form_id) {
  $ids = \Drupal::entityQuery('captcha_point')
    ->condition('formId', $form_id)
    ->execute();
  return $ids ? CaptchaPoint::load(reset($ids)) : NULL;
}