You are here

ResponseTest.php in Commerce Core 8.2

File

tests/src/Functional/ResponseTest.php
View source
<?php

namespace Drupal\Tests\commerce\Functional;


/**
 * Tests to see if the "x-commerce-core" header is added.
 *
 * @group commerce
 */
class ResponseTest extends CommerceBrowserTestBase {

  /**
   * Test to see if the "x-commerce-core" header is added.
   */
  public function testGeneratorStringAndHeader() {
    $this
      ->drupalGet('<front>');
    $this
      ->assertSession()
      ->statusCodeEquals(200);
    list($version) = explode('.', \Drupal::VERSION, 2);
    $this
      ->assertSession()
      ->responseContains('Drupal ' . $version . ' (https://www.drupal.org); Commerce 2');
    $this
      ->assertEquals('2', $this
      ->drupalGetHeader('X-Commerce-Core'));
  }

}

Classes

Namesort descending Description
ResponseTest Tests to see if the "x-commerce-core" header is added.