Version 1
[yaffs-website] / web / core / modules / basic_auth / tests / modules / basic_auth_test / src / BasicAuthTestController.php
diff --git a/web/core/modules/basic_auth/tests/modules/basic_auth_test/src/BasicAuthTestController.php b/web/core/modules/basic_auth/tests/modules/basic_auth_test/src/BasicAuthTestController.php
new file mode 100644 (file)
index 0000000..635e842
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+
+namespace Drupal\basic_auth_test;
+
+class BasicAuthTestController {
+
+  /**
+   * @see \Drupal\basic_auth\Tests\Authentication\BasicAuthTest::testControllerNotCalledBeforeAuth()
+   */
+  public function modifyState() {
+    \Drupal::state()->set('basic_auth_test.state.controller_executed', TRUE);
+    return ['#markup' => 'Done'];
+  }
+
+  /**
+   * @see \Drupal\basic_auth\Tests\Authentication\BasicAuthTest::testControllerNotCalledBeforeAuth()
+   */
+  public function readState() {
+    // Mark this page as being uncacheable.
+    \Drupal::service('page_cache_kill_switch')->trigger();
+
+    return [
+      '#markup' => \Drupal::state()->get('basic_auth_test.state.controller_executed') ? 'yep' : 'nope',
+      '#cache' => [
+        'max-age' => 0,
+      ],
+    ];
+  }
+
+}