Version 1
[yaffs-website] / web / core / modules / system / tests / modules / accept_header_routing_test / src / AcceptHeaderRoutingTestServiceProvider.php
diff --git a/web/core/modules/system/tests/modules/accept_header_routing_test/src/AcceptHeaderRoutingTestServiceProvider.php b/web/core/modules/system/tests/modules/accept_header_routing_test/src/AcceptHeaderRoutingTestServiceProvider.php
new file mode 100644 (file)
index 0000000..983a60c
--- /dev/null
@@ -0,0 +1,23 @@
+<?php
+
+namespace Drupal\accept_header_routing_test;
+
+use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\DependencyInjection\ServiceModifierInterface;
+
+/**
+ * Service provider for the accept_header_routing_test module.
+ */
+class AcceptHeaderRoutingTestServiceProvider implements ServiceModifierInterface {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function alter(ContainerBuilder $container) {
+    // Remove the basic content negotation middleware and replace it with a
+    // basic header based one.
+    $container->register('http_middleware.negotiation', 'Drupal\accept_header_routing_test\AcceptHeaderMiddleware')
+      ->addTag('http_middleware', ['priority' => 400]);
+  }
+
+}