You are here

public function DuplicateContentPreventionMiddlewareTest::duplicateContentPreventionProvider in CDN 8.3

File

tests/src/Unit/StackMiddleware/DuplicateContentPreventionMiddlewareTest.php, line 65

Class

DuplicateContentPreventionMiddlewareTest
@coversDefaultClass \Drupal\cdn\StackMiddleware\DuplicateContentPreventionMiddleware @group StackMiddleware @group cdn

Namespace

Drupal\Tests\cdn\Unit\StackMiddleware

Code

public function duplicateContentPreventionProvider() {

  // @codingStandardsIgnoreStart
  return [
    // HTML requested: the response is a redirect when requested by a CDN.
    [
      '/',
      'Mozilla',
      [],
      FALSE,
    ],
    [
      '/node/1',
      'Mozilla',
      [],
      FALSE,
    ],
    [
      '/node/1.html',
      'Mozilla',
      [],
      FALSE,
    ],
    [
      '/node/1.htm',
      'Mozilla',
      [],
      FALSE,
    ],
    [
      '/node/1.php',
      'Mozilla',
      [],
      FALSE,
    ],
    [
      '/',
      'Amazon CloudFront',
      [],
      'http://๐Ÿท.com/',
    ],
    [
      '/node/1',
      'Amazon CloudFront',
      [],
      'http://๐Ÿท.com/node/1',
    ],
    [
      '/node/1.html',
      'Amazon CloudFront',
      [],
      'http://๐Ÿท.com/node/1.html',
    ],
    [
      '/node/1.htm',
      'Amazon CloudFront',
      [],
      'http://๐Ÿท.com/node/1.htm',
    ],
    [
      '/node/1.php',
      'Amazon CloudFront',
      [],
      'http://๐Ÿท.com/node/1.php',
    ],
    [
      '/',
      'Mozilla',
      [
        'CF-RAY' => $this
          ->randomMachineName(),
      ],
      'http://๐Ÿท.com/',
    ],
    [
      '/node/1',
      'Mozilla',
      [
        'CF-RAY' => $this
          ->randomMachineName(),
      ],
      'http://๐Ÿท.com/node/1',
    ],
    [
      '/node/1.html',
      'Mozilla',
      [
        'CF-RAY' => $this
          ->randomMachineName(),
      ],
      'http://๐Ÿท.com/node/1.html',
    ],
    [
      '/node/1.htm',
      'Mozilla',
      [
        'CF-RAY' => $this
          ->randomMachineName(),
      ],
      'http://๐Ÿท.com/node/1.htm',
    ],
    [
      '/node/1.php',
      'Mozilla',
      [
        'CF-RAY' => $this
          ->randomMachineName(),
      ],
      'http://๐Ÿท.com/node/1.php',
    ],
    // File requested: the response is never a redirect.
    [
      '/misc/jquery.js',
      'Mozilla',
      [],
      FALSE,
    ],
    [
      '/misc/jquery.js',
      'Amazon CloudFront',
      [],
      FALSE,
    ],
    // Generated file requested: the response is never a redirect.
    [
      '/sites/default/files/styles/thumbnail/foobar.png',
      'Mozilla',
      [],
      FALSE,
    ],
    [
      '/sites/default/files/styles/thumbnail/foobar.png',
      'Amazon CloudFront',
      [],
      FALSE,
    ],
  ];

  // @codingStandardsIgnoreEnd
}