You are here

function SecureSiteForceAlwaysTest::testSecureSiteForceAlwaysCronForm in Secure Site 8

Try cron.php with only form authentication enabled.

File

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

Class

SecureSiteForceAlwaysTest
Functional tests for page requests with authentication always forced.

Namespace

Drupal\securesite\Tests\ForcedAuth

Code

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