diff -u b/amp.module b/amp.module
--- b/amp.module
+++ b/amp.module
@@ -330,6 +330,9 @@
  * Implements hook_url_inbound_alter().
  *
  * Rewrites the active path for AMP pages to the non-AMP path.
+ *
+ * Allows url() to act as the central source of manipulation
+ * for both inbound and outbound urls.
  */
 function amp_url_inbound_alter(&$path, $original_path, $path_language) {
   if (!amp_is_amp_request()) {
@@ -359,6 +362,30 @@
 }
 
 /**
+ * Implements hook_url_outbound_alter().
+ *
+ * Change the url depending on the amp format specified.
+ *
+ * Allows url() to act as the central source of manipulation
+ * for both inbound and outbound urls.
+ */
+function amp_url_outbound_alter(&$path, &$options, $original_path) {
+  // The 'amp' query param can be set to null so need to check for key not value.
+  if (isset($options['query']) && array_key_exists('amp', $options['query'])) {
+    switch (variable_get('amp_url_format', 'query_string')) {
+      case 'suffix':
+        $path .= '/amp';
+        unset($options['query']['amp']);
+        break;
+      case 'prefix':
+        $path = 'amp/' . $path;
+        unset($options['query']['amp']);
+        break;
+    }
+  }
+}
+
+/**
  * Determines whether a request should return AMP HTML.
  */
 function amp_is_amp_request() {
@@ -457,7 +484,7 @@
 /**
  * Submit handler for viewing the AMP page.
  */
-function amp_node_form_submit(&$form, $form_state) {
+function amp_node_form_submit($form, &$form_state) {
   if (!empty($form_state['node']->path['alias'])) {
     $current_path = $form_state['node']->path['alias'];
   }
@@ -465,17 +492,25 @@
     $current_path = 'node/' . $form_state['node']->nid;
   }
 
-  // We need to remove destination if its there
+  // We should respect all the usual redirection exceptions,
+  // except those set in the query string.
   unset($_GET['destination']);
 
   // We must pass amp => null as there is no value to the amp parameter
-  drupal_goto($current_path, array('query' => array('amp' => null)));
+  $form_state['redirect'] = array(
+    $current_path,
+    array(
+      'query' => array(
+        'amp' => NULL,
+      ),
+    ),
+  );
 }
 
 /**
  * Submit handler for viewing the AMP page with warnings/fixes messages
  */
-function amp_node_form_submit_warnfix(&$form, $form_state) {
+function amp_node_form_submit_warnfix($form, &$form_state) {
   if (!empty($form_state['node']->path['alias'])) {
     $current_path = $form_state['node']->path['alias'];
   }
@@ -483,11 +518,20 @@
     $current_path = 'node/' . $form_state['node']->nid;
   }
 
-  // We need to remove destination if its there
+  // We should respect all the usual redirection exceptions,
+  // except those set in the query string.
   unset($_GET['destination']);
 
   // We must pass amp => null as there is no value to the amp parameter
-  drupal_goto($current_path, array('query' => array('amp' => null, 'warnfix' => null)));
+  $form_state['redirect'] = array(
+    $current_path,
+    array(
+      'query' => array(
+        'amp' => NULL,
+        'warnfix' => null
+      ),
+    ),
+  );
 }
 
 /**
@@ -700,18 +744,9 @@
   if ($view_mode == 'full' && node_is_page($node) && in_array($node->type, amp_get_enabled_types())) {
     $uri = entity_uri('node', $node);
     $uri['options']['absolute'] = TRUE;
+    $uri['options']['query']['amp'] = NULL;
     $alias_path = drupal_get_path_alias($uri['path']);
-    switch (variable_get('amp_url_format', 'query_string')) {
-      case 'query_string':
-        $uri['options']['query']['amp'] = NULL;
-        break;
-      case 'suffix':
-        $alias_path = $alias_path . '/amp';
-        break;
-      case 'prefix':
-        $alias_path = 'amp/' . $alias_path;
-        break;
-    }
+
     drupal_add_html_head_link(array('rel' => 'amphtml', 'href' => url($alias_path, $uri['options'])), TRUE);
   }
 
reverted:
--- b/amp.test
+++ a/amp.test
@@ -6,7 +6,6 @@
  */
 
 class AmpTestCase extends DrupalWebTestCase {
-  protected $admin_user;
 
   public static function getInfo() {
     return array(
@@ -17,28 +16,10 @@
   }
 
   protected function setUp() {
+    // Enable AMP module.
+    parent::setUp('amp', 'composer_manager');
-    // Enable modules.
-    parent::setUp('field_ui', 'amp', 'composer_manager');
-
-    // Create Admin user.
-    $this->admin_user = $this->drupalCreateUser(array(
-        'access administration pages',
-        'administer content types',
-        'administer site configuration',
-        'administer fields',
-        'create article content',
-      )
-    );
-    $this->drupalLogin($this->admin_user);
-
     // Install the AMP theme.
     theme_enable(array('amptheme', 'ampsubtheme_example'));
-
-    // Enable AMP display on article content.
-    $this->drupalGet("admin/structure/types/manage/article/display");
-    $this->assertResponse(200);
-    $edit = ["view_modes_custom[amp]" => '1'];
-    $this->drupalPost(NULL, $edit, t('Save'));
   }
 
   /**
@@ -48,11 +29,18 @@
     global $base_url;
 
     // Login as an admin user.
+    $admin_user = $this->drupalCreateUser(array('administer content types'));
+    $this->drupalLogin($admin_user);
-    $this->drupalLogin($this->admin_user);
 
     // Create a node to test AMP metadata.
     $node = $this->drupalCreateNode(array('type' => 'article'));
 
+    // Enable AMP display on article content.
+    $this->drupalGet("admin/structure/types/manage/article/display");
+    $this->assertResponse(200);
+    $edit = ["view_modes_custom[amp]" => '1'];
+    $this->drupalPost(NULL, $edit, t('Save'));
+
     // Check the full display.
     $this->drupalGet('node/' . $node->nid);
     $this->assertResponse(200);
@@ -68,10 +56,8 @@
     // Configure AMP field formatters.
     $this->drupalGet('admin/structure/types/manage/article/display/amp');
     $this->assertResponse(200);
+    $edit = ["fields[field_image][type]" => 'amp_image'];
+    $edit = ["fields[body][type]" => 'amp_text'];
-    $edit = [
-      "fields[field_image][type]" => 'amp_image',
-      "fields[body][type]" => 'amp_text',
-    ];
     $this->drupalPost(NULL, $edit, t('Save'));
 
     // Check the warnfix messages.
@@ -82,218 +68,3 @@
     $this->assertRaw('PASS');
   }
 }
-
-class AmpTestUrlFormats extends DrupalWebTestCase {
-  protected $admin_user;
-
-  public static function getInfo() {
-    return array(
-      'name' => 'AMP Url formats',
-      'description' => 'Tests AMP pages using prefix /amp and query string ?amp.',
-      'group' => 'AMP',
-    );
-  }
-
-  protected function setUp() {
-    // Enable modules.
-    parent::setUp('field_ui', 'path', 'amp', 'composer_manager');
-
-    // Create Admin user.
-    $this->admin_user = $this->drupalCreateUser(array(
-        'create url aliases',
-        'access administration pages',
-        'administer site configuration',
-        'administer content types',
-        'administer fields',
-        'create article content',
-        'edit any article content',
-      )
-    );
-    $this->drupalLogin($this->admin_user);
-
-    // Install the AMP theme.
-    theme_enable(array('amptheme', 'ampsubtheme_example'));
-
-    // Enable AMP display on article content.
-    $this->drupalGet("admin/structure/types/manage/article/display");
-    $this->assertResponse(200);
-    $edit = ["view_modes_custom[amp]" => '1'];
-    $this->drupalPost(NULL, $edit, t('Save'));
-  }
-
-  /**
-   * Test the url with query string ?amp.
-   */
-  public function testAmpUrlFormatQueryString() {
-    global $base_url;
-
-    // Login as an admin user.
-    $this->drupalLogin($this->admin_user);
-
-    // Test with query string ?amp
-    $this->drupalGet('admin/config/content/amp');
-    $this->assertResponse(200);
-    $this->assertRaw('Query string (www.example.com/article?amp)');
-    $edit = ["amp_url_format" => 'query_string'];
-    $this->drupalPost(NULL, $edit, t('Save configuration'));
-
-    // Create a node to test the url detection.
-    $this->drupalGet('node/add/article');
-    $this->assertResponse(200);
-    $edit = [
-      "title" => 'AMP Page foo test',
-      "body[und][0][value]" => 'Foo',
-      "path[alias]" => 'foo',
-    ];
-    $this->drupalPost(NULL, $edit, t('Save'));
-
-    // Check link rel on full display.
-    $this->drupalGet('foo');
-    $this->assertResponse(200);
-    $this->assertRaw('link rel="amphtml" href="' . $base_url . '/foo?amp"');
-
-    // Same check as above, using node/nid.
-    $this->drupalGet('node/1');
-    $this->assertResponse(200);
-    $this->assertRaw('link rel="amphtml" href="' . $base_url . '/foo?amp"');
-
-    // Check AMP page with prefix path 'amp' should 404.
-    $this->drupalGet('amp/foo');
-    $this->assertResponse(404);
-
-    // Check AMP page with suffix path 'amp' should 404.
-    $this->drupalGet('foo/amp');
-    $this->assertResponse(404);
-
-    // Check AMP page with query string ?amp.
-    $this->drupalGet('foo', array('query' => array('amp' => NULL)));
-    $this->assertResponse(200);
-    $this->assertRaw('<html amp lang');
-    $this->assertRaw('link rel="canonical" href="' . $base_url . '/foo"');
-
-    // Check admin UI is not an amp page.
-    $this->drupalGet('node/1/edit', array('query' => array('amp' => NULL)));
-    $this->assertNoRaw('<html amp lang');
-  }
-
-  /**
-   * Test the url with prefix path 'amp'.
-   */
-  public function testAmpUrlFormatPrefix() {
-    global $base_url;
-
-    // Login as an admin user.
-    $this->drupalLogin($this->admin_user);
-
-    // Test with prefix path 'amp'
-    $this->drupalGet('admin/config/content/amp');
-    $this->assertResponse(200);
-    $this->assertRaw('Path prefix (www.example.com/amp/article)');
-    $edit = ['amp_url_format' => 'prefix'];
-    $this->drupalPost(NULL, $edit, t('Save configuration'));
-    menu_cache_clear_all();
-
-    // Create a node to test the url detection.
-    $this->drupalGet('node/add/article');
-    $this->assertResponse(200);
-    $edit = [
-      "title" => 'AMP Page foo test',
-      "body[und][0][value]" => 'Foo',
-      "path[alias]" => 'foo',
-    ];
-    $this->drupalPost(NULL, $edit, t('Save'));
-
-    // Check link rel on full display.
-    $this->drupalGet('foo');
-    $this->assertResponse(200);
-    $this->assertRaw('link rel="amphtml" href="' . $base_url . '/amp/foo"');
-
-    // Same check as above, using node/nid.
-    $this->drupalGet('node/1');
-    $this->assertResponse(200);
-    $this->assertRaw('link rel="amphtml" href="' . $base_url . '/amp/foo"');
-
-    // Check AMP page with prefix path 'amp' should work.
-    $this->drupalGet('amp/foo');
-    $this->assertResponse(200);
-    $this->assertRaw('<html amp lang');
-    $this->assertRaw('link rel="canonical" href="' . $base_url . '/foo"');
-
-    // Check AMP page with suffix path 'amp' should 404.
-    $this->drupalGet('foo/amp');
-    $this->assertResponse(404);
-
-    // Check AMP page with query string ?amp should show full display.
-    $this->drupalGet('foo', array('query' => array('amp' => NULL)));
-    $this->assertResponse(200);
-    $this->assertNoRaw('<html amp lang');
-    $this->assertRaw('link rel="amphtml" href="' . $base_url . '/amp/foo"');
-
-    // This should show full display.
-    $this->drupalGet('foo');
-    $this->assertResponse(200);
-    $this->assertNoRaw('<html amp lang');
-    $this->assertRaw('link rel="amphtml" href="' . $base_url . '/amp/foo"');
-  }
-
-  /**
-   * Test the url with suffix path 'amp'.
-   */
-  public function testAmpUrlFormatSuffix() {
-    global $base_url;
-
-    // Login as an admin user.
-    $this->drupalLogin($this->admin_user);
-
-    // Test with suffix path 'amp'
-    $this->drupalGet('admin/config/content/amp');
-    $this->assertResponse(200);
-    $this->assertRaw('Path suffix (www.example.com/article/amp)');
-    $edit = ['amp_url_format' => 'suffix'];
-    $this->drupalPost(NULL, $edit, t('Save configuration'));
-    menu_cache_clear_all();
-
-    // Create a node to test the url detection.
-    $this->drupalGet('node/add/article');
-    $this->assertResponse(200);
-    $edit = [
-      "title" => 'AMP Page foo test',
-      "body[und][0][value]" => 'Foo',
-      "path[alias]" => 'foo',
-    ];
-    $this->drupalPost(NULL, $edit, t('Save'));
-
-    // Check link rel on full display.
-    $this->drupalGet('foo');
-    $this->assertResponse(200);
-    $this->assertRaw('link rel="amphtml" href="' . $base_url . '/foo/amp"');
-
-    // Same check as above, using node/nid.
-    $this->drupalGet('node/1');
-    $this->assertResponse(200);
-    $this->assertRaw('link rel="amphtml" href="' . $base_url . '/foo/amp"');
-
-    // Check AMP page with prefix path 'amp' should 404.
-    $this->drupalGet('amp/foo');
-    $this->assertResponse(404);
-
-    // Check AMP page with suffix path 'amp' should work.
-    $this->drupalGet('foo/amp');
-    $this->assertResponse(200);
-    $this->assertRaw('<html amp lang');
-    $this->assertRaw('link rel="canonical" href="' . $base_url . '/foo"');
-
-    // Check AMP page with query string ?amp should show full display.
-    $this->drupalGet('foo', array('query' => array('amp' => NULL)));
-    $this->assertResponse(200);
-    $this->assertNoRaw('<html amp lang');
-    $this->assertRaw('link rel="amphtml" href="' . $base_url . '/foo/amp"');
-
-    // This should show full display.
-    $this->drupalGet('foo');
-    $this->assertResponse(200);
-    $this->assertNoRaw('<html amp lang');
-    $this->assertRaw('link rel="amphtml" href="' . $base_url . '/foo/amp"');
-  }
-
-}
only in patch2:
unchanged:
--- a/amp.info
+++ b/amp.info
@@ -6,3 +6,6 @@ php = 5.5
 dependencies[] = token
 dependencies[] = ctools
 files[] = tests/amp.test
+files[] = tests/amp_url_formats.test
+
+testing_api = 2.x
\ No newline at end of file
only in patch2:
unchanged:
--- a/tests/amp.test
+++ b/tests/amp.test
@@ -22,14 +22,23 @@ class AmpTestCase extends DrupalWebTestCase {
 
     // Create Admin user.
     $this->admin_user = $this->drupalCreateUser(array(
+        'access administration pages',
         'administer content types',
+        'administer site configuration',
         'administer fields',
+        'create article content',
       )
     );
     $this->drupalLogin($this->admin_user);
 
     // Install the AMP theme.
     theme_enable(array('amptheme', 'ampsubtheme_example'));
+
+    // Enable AMP display on article content.
+    $this->drupalGet("admin/structure/types/manage/article/display");
+    $this->assertResponse(200);
+    $edit = ["view_modes_custom[amp]" => '1'];
+    $this->drupalPost(NULL, $edit, t('Save'));
   }
 
   /**
@@ -42,12 +51,6 @@ class AmpTestCase extends DrupalWebTestCase {
     // Create a node to test AMP metadata.
     $node = $this->drupalCreateNode(array('type' => 'article'));
 
-    // Enable AMP display on article content.
-    $this->drupalGet("admin/structure/types/manage/article/display");
-    $this->assertResponse(200);
-    $edit = ["view_modes_custom[amp]" => '1'];
-    $this->drupalPost(NULL, $edit, t('Save'));
-
     // Check the full display.
     $this->drupalGet('node/' . $node->nid);
     $this->assertResponse(200);
only in patch2:
unchanged:
--- /dev/null
+++ b/tests/amp_url_formats.test
@@ -0,0 +1,254 @@
+<?php
+
+/**
+ * @file
+ * Tests for amp.module.
+ */
+
+class AmpTestUrlFormats extends DrupalWebTestCase {
+  protected $admin_user;
+
+  public static function getInfo() {
+    return array(
+      'name' => 'AMP Url formats',
+      'description' => 'Tests AMP pages using prefix /amp and query string ?amp.',
+      'group' => 'AMP',
+    );
+  }
+
+  protected function setUp() {
+    // Enable modules.
+    parent::setUp('field_ui', 'amp_test', 'path', 'amp');
+
+    // Create Admin user.
+    $this->admin_user = $this->drupalCreateUser(array(
+        'create url aliases',
+        'access administration pages',
+        'administer site configuration',
+        'administer content types',
+        'administer fields',
+        'create article content',
+        'edit any article content',
+      )
+    );
+    $this->drupalLogin($this->admin_user);
+
+    // Install the AMP theme.
+    theme_enable(array('amptheme', 'ampsubtheme_example'));
+
+    // Enable AMP display on article content.
+    $this->drupalGet("admin/structure/types/manage/article/display");
+    $this->assertResponse(200);
+    $edit = ["view_modes_custom[amp]" => '1'];
+    $this->drupalPost(NULL, $edit, t('Save'));
+  }
+
+  /**
+   * Get a url without manipulation.
+   *
+   * Avoids manipulation of the url by drupal,
+   * required when we need to test a url that
+   * we know the system wants to re-write.
+   *
+   * @param $path
+   *   The path that we want to load.
+   * @param array $headers
+   *   The request headers.
+   *
+   * @return mixed
+   */
+  protected function get($path, array $headers = array()) {
+    $url = $this->getAbsoluteUrl($path);
+
+    // We re-using a CURL connection here. If that connection still has certain
+    // options set, it might change the GET into a POST. Make sure we clear out
+    // previous options.
+    $out = $this->curlExec(array(CURLOPT_HTTPGET => TRUE, CURLOPT_URL => $url, CURLOPT_NOBODY => FALSE, CURLOPT_HTTPHEADER => $headers));
+    $this->refreshVariables(); // Ensure that any changes to variables in the other thread are picked up.
+
+    // Replace original page output with new output from redirected page(s).
+    if ($new = $this->checkForMetaRefresh()) {
+      $out = $new;
+    }
+    $this->verbose('GET request to: ' . $path .
+      '<hr />Ending URL: ' . $this->getUrl() .
+      '<hr />' . $out);
+    return $out;
+  }
+
+  /**
+   * Test the url with query string ?amp.
+   */
+  public function testAmpUrlFormatQueryString() {
+    global $base_url;
+
+    // Login as an admin user.
+    $this->drupalLogin($this->admin_user);
+
+    // Test with query string ?amp
+    $this->drupalGet('admin/config/content/amp');
+    $this->assertResponse(200);
+    $this->assertRaw('Query string (www.example.com/article?amp)');
+    $edit = ["amp_url_format" => 'query_string'];
+    $this->drupalPost(NULL, $edit, t('Save configuration'));
+
+    // Create a node to test the url detection.
+    $this->drupalGet('node/add/article');
+    $this->assertResponse(200);
+    $edit = [
+      "title" => 'AMP Page foo test',
+      "body[und][0][value]" => 'Foo',
+      "path[alias]" => 'foo',
+    ];
+    $this->drupalPost(NULL, $edit, t('Save'));
+
+    // Check link rel on full display.
+    $this->drupalGet('foo');
+    $this->assertResponse(200);
+    $this->assertRaw('link rel="amphtml" href="' . $base_url . '/foo?amp"');
+
+    // Same check as above, using node/nid.
+    $this->drupalGet('node/1');
+    $this->assertResponse(200);
+    $this->assertRaw('link rel="amphtml" href="' . $base_url . '/foo?amp"');
+
+    // Check AMP page with prefix path 'amp' should 404.
+    $this->drupalGet('amp/foo');
+    $this->assertResponse(404);
+
+    // Check AMP page with suffix path 'amp' should 404.
+    $this->drupalGet('foo/amp');
+    $this->assertResponse(404);
+
+    // Check AMP page with query string ?amp.
+    $this->get('foo?amp');
+    $this->assertResponse(200);
+    $this->assertRaw('<html amp lang');
+    $this->assertRaw('link rel="canonical" href="' . $base_url . '/foo"');
+
+    // Check admin UI is not an amp page.
+    $this->drupalGet('node/1/edit', array('query' => array('amp' => NULL)));
+    $this->assertNoRaw('<html amp lang');
+  }
+
+  /**
+   * Test the url with prefix path 'amp'.
+   */
+  public function testAmpUrlFormatPrefix() {
+    global $base_url;
+
+    // Login as an admin user.
+    $this->drupalLogin($this->admin_user);
+
+    // Test with prefix path 'amp'
+    $this->drupalGet('admin/config/content/amp');
+    $this->assertResponse(200);
+    $this->assertRaw('Path prefix (www.example.com/amp/article)');
+    $edit = ['amp_url_format' => 'prefix'];
+    $this->drupalPost(NULL, $edit, t('Save configuration'));
+    menu_cache_clear_all();
+
+    // Create a node to test the url detection.
+    $this->drupalGet('node/add/article');
+    $this->assertResponse(200);
+    $edit = [
+      "title" => 'AMP Page foo test',
+      "body[und][0][value]" => 'Foo',
+      "path[alias]" => 'foo',
+    ];
+    $this->drupalPost(NULL, $edit, t('Save'));
+
+    // Check link rel on full display.
+    $this->drupalGet('foo');
+    $this->assertResponse(200);
+    $this->assertRaw('link rel="amphtml" href="' . $base_url . '/amp/foo"');
+
+    // Same check as above, using node/nid.
+    $this->drupalGet('node/1');
+    $this->assertResponse(200);
+    $this->assertRaw('link rel="amphtml" href="' . $base_url . '/amp/foo"');
+
+    // Check AMP page with prefix path 'amp' should work.
+    $this->drupalGet('amp/foo');
+    $this->assertResponse(200);
+    $this->assertRaw('<html amp lang');
+    $this->assertRaw('link rel="canonical" href="' . $base_url . '/foo"');
+
+    // Check AMP page with suffix path 'amp' should 404.
+    $this->drupalGet('foo/amp');
+    $this->assertResponse(404);
+
+    // This should show full display.
+    $this->drupalGet('foo');
+    $this->assertResponse(200);
+    $this->assertNoRaw('<html amp lang');
+    $this->assertRaw('link rel="amphtml" href="' . $base_url . '/amp/foo"');
+
+    // Check AMP page with query string ?amp should show full display.
+    $this->get('foo?amp');
+    $this->assertResponse(200);
+    $this->assertNoRaw('<html amp lang');
+    $this->assertRaw('link rel="amphtml" href="' . $base_url . '/amp/foo"');
+  }
+
+  /**
+   * Test the url with suffix path 'amp'.
+   */
+  public function testAmpUrlFormatSuffix() {
+    global $base_url;
+
+    // Login as an admin user.
+    $this->drupalLogin($this->admin_user);
+
+    // Test with suffix path 'amp'
+    $this->drupalGet('admin/config/content/amp');
+    $this->assertResponse(200);
+    $this->assertRaw('Path suffix (www.example.com/article/amp)');
+    $edit = ['amp_url_format' => 'suffix'];
+    $this->drupalPost(NULL, $edit, t('Save configuration'));
+    menu_cache_clear_all();
+
+    // Create a node to test the url detection.
+    $this->drupalGet('node/add/article');
+    $this->assertResponse(200);
+    $edit = [
+      "title" => 'AMP Page foo test',
+      "body[und][0][value]" => 'Foo',
+      "path[alias]" => 'foo',
+    ];
+    $this->drupalPost(NULL, $edit, t('Save'));
+
+    // Check link rel on full display.
+    $this->drupalGet('foo');
+    $this->assertResponse(200);
+    $this->assertRaw('link rel="amphtml" href="' . $base_url . '/foo/amp"');
+
+    // Same check as above, using node/nid.
+    $this->drupalGet('node/1');
+    $this->assertResponse(200);
+    $this->assertRaw('link rel="amphtml" href="' . $base_url . '/foo/amp"');
+
+    // Check AMP page with prefix path 'amp' should 404.
+    $this->drupalGet('amp/foo');
+    $this->assertResponse(404);
+
+    // Check AMP page with suffix path 'amp' should work.
+    $this->drupalGet('foo/amp');
+    $this->assertResponse(200);
+    $this->assertRaw('<html amp lang');
+    $this->assertRaw('link rel="canonical" href="' . $base_url . '/foo"');
+
+    // Check AMP page with query string ?amp should show full display.
+    $this->get('foo?amp');
+    $this->assertResponse(200);
+    $this->assertNoRaw('<html amp lang');
+    $this->assertRaw('link rel="amphtml" href="' . $base_url . '/foo/amp"');
+
+    // This should show full display.
+    $this->drupalGet('foo');
+    $this->assertResponse(200);
+    $this->assertNoRaw('<html amp lang');
+    $this->assertRaw('link rel="amphtml" href="' . $base_url . '/foo/amp"');
+  }
+
+}
