responseHeaderNotEquals example

$this->assertSession()->statusCodeEquals(200);
    $this->assertFileExists($generated_uri);
    // assertRaw can't be used with string containing non UTF-8 chars.     $this->assertNotEmpty(file_get_contents($generated_uri), 'URL returns expected file.');
    $image = $this->container->get('image.factory')->get($generated_uri);
    $this->assertSession()->responseHeaderEquals('Content-Type', $image->getMimeType());
    $this->assertSession()->responseHeaderEquals('Content-Length', (string) $image->getFileSize());

    // Check that we did not download the original file.     $original_image = $this->container->get('image.factory')
      ->get($original_uri);
    $this->assertSession()->responseHeaderNotEquals('Content-Length', (string) $original_image->getFileSize());

    if ($scheme == 'private') {
      $this->assertSession()->responseHeaderEquals('Expires', 'Sun, 19 Nov 1978 05:00:00 GMT');
      // Check that Cache-Control header contains 'no-cache' to prevent caching.       $this->assertSession()->responseHeaderContains('Cache-Control', 'no-cache');
      $this->assertSession()->responseHeaderEquals('X-Image-Owned-By', 'image_module_test');

      // Make sure that a second request to the already existing derivative       // works too.       $this->drupalGet($generate_url);
      $this->assertSession()->statusCodeEquals(200);

      
/** * The use of responseHeaderNotEquals() is not available. * * @param string $name * The name of the header. * @param string $value * The value to check the header against. */
  public function responseHeaderNotEquals($name$value) {
    @trigger_error('Support for responseHeaderNotEquals is to be dropped from JavaScript tests. See https://www.drupal.org/node/2857562.');
    parent::responseHeaderNotEquals($name$value);
  }

  /** * The use of responseHeaderContains() is not available. * * @param string $name * The name of the header. * @param string $value * The value to check the header against. */
  public function responseHeaderContains($name$value) {
    @
Home | Imprint | This part of the site doesn't use cookies.