You are here

function SecureSiteForceAlwaysTest::testSecureSiteForceAlwaysCronAll in Secure Site 8

Try cron.php with all authentication types enabled.

File

src/Tests/ForcedAuth/SecureSiteForceAlwaysTest.php, line 114
Contains Drupal\securesite\Tests\ForcedAuth\SecureSiteForceAlwaysTest

Class

SecureSiteForceAlwaysTest
Functional tests for page requests with authentication always forced.

Namespace

Drupal\securesite\Tests\ForcedAuth

Code

function testSecureSiteForceAlwaysCronAll() {
  \Drupal::config('securesite.settings')
    ->set('securesite_type', array(
    SECURESITE_FORM,
    SECURESITE_BASIC,
    SECURESITE_DIGEST,
  ))
    ->save();
  $cron_last = \Drupal::state()
    ->get('system.cron_last') ?: NULL;
  $this
    ->drupalGet(url(NULL, array(
    'absolute' => TRUE,
  )) . 'cron.php');
  $this
    ->assertTrue((\Drupal::state()
    ->get('system.cron_last') ?: NULL) == $cron_last, t('Trying cron.php with all authentication types enabled.'));
}