[ Index ]

PHP Cross Reference of YOURLS

title

Body

[close]

/tests/data/scripts/scenarios/ -> maybe-require-auth.php (source)

   1  <?php
   2  /**
   3   * Scenario: call yourls_maybe_require_auth() with valid credentials at hand.
   4   *
   5   * Run by scripts/run-scenario.php, in a process where YOURLS_PRIVATE has been defined to the
   6   * value under test. Depending on that value, includes/auth.php is loaded (and defines
   7   * YOURLS_USER) or not.
   8   *
   9   * (Credentials and nonce are needed so that the `YOURLS_PRIVATE = true` scenario actually completes a login.
  10   */
  11  
  12  if( !defined( 'YOURLS_ABSPATH' ) ) die();
  13  
  14  $_REQUEST['username'] = 'yourls';
  15  $_REQUEST['password'] = 'secret-ci-test';
  16  $_REQUEST['nonce']    = yourls_create_nonce( 'admin_login' );
  17  
  18  yourls_maybe_require_auth();


Generated: Sun Sep 6 05:10:08 2026 Cross-referenced by PHPXref 0.7.1