Unverified Commit c58a76fe authored by alexpott's avatar alexpott
Browse files

Issue #3126848 by mondrake, longwave, daffie: Replace usage of the $ignoreCase...

Issue #3126848 by mondrake, longwave, daffie: Replace usage of the $ignoreCase parameter of assertContains(), that is deprecated

(cherry picked from commit 125b33ab)
parent b1076312
...@@ -247,7 +247,7 @@ public function testPageCache() { ...@@ -247,7 +247,7 @@ public function testPageCache() {
// Fill the cache. // Fill the cache.
$this->drupalGet('system-test/set-header', ['query' => ['name' => 'Foo', 'value' => 'bar']]); $this->drupalGet('system-test/set-header', ['query' => ['name' => 'Foo', 'value' => 'bar']]);
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'MISS', 'Page was not cached.'); $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'MISS', 'Page was not cached.');
$this->assertContains('cookie', explode(',', strtolower($this->drupalGetHeader('Vary'))), 'Vary header was sent.', TRUE); $this->assertContains('cookie', explode(',', strtolower($this->drupalGetHeader('Vary'))), 'Vary header was sent.');
// Symfony's Response logic determines a specific order for the subvalues // Symfony's Response logic determines a specific order for the subvalues
// of the Cache-Control header, even if they are explicitly passed in to // of the Cache-Control header, even if they are explicitly passed in to
// the response header bag in a different order. // the response header bag in a different order.
...@@ -258,7 +258,7 @@ public function testPageCache() { ...@@ -258,7 +258,7 @@ public function testPageCache() {
// Check cache. // Check cache.
$this->drupalGet('system-test/set-header', ['query' => ['name' => 'Foo', 'value' => 'bar']]); $this->drupalGet('system-test/set-header', ['query' => ['name' => 'Foo', 'value' => 'bar']]);
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', 'Page was cached.'); $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', 'Page was cached.');
$this->assertContains('cookie', explode(',', strtolower($this->drupalGetHeader('Vary'))), 'Vary header was sent.', TRUE); $this->assertContains('cookie', explode(',', strtolower($this->drupalGetHeader('Vary'))), 'Vary header was sent.');
$this->assertEqual($this->drupalGetHeader('Cache-Control'), 'max-age=300, public', 'Cache-Control header was sent.'); $this->assertEqual($this->drupalGetHeader('Cache-Control'), 'max-age=300, public', 'Cache-Control header was sent.');
$this->assertEqual($this->drupalGetHeader('Expires'), 'Sun, 19 Nov 1978 05:00:00 GMT', 'Expires header was sent.'); $this->assertEqual($this->drupalGetHeader('Expires'), 'Sun, 19 Nov 1978 05:00:00 GMT', 'Expires header was sent.');
$this->assertEqual($this->drupalGetHeader('Foo'), 'bar', 'Custom header was sent.'); $this->assertEqual($this->drupalGetHeader('Foo'), 'bar', 'Custom header was sent.');
...@@ -274,7 +274,7 @@ public function testPageCache() { ...@@ -274,7 +274,7 @@ public function testPageCache() {
$this->drupalLogin($user); $this->drupalLogin($user);
$this->drupalGet('system-test/set-header', ['query' => ['name' => 'Foo', 'value' => 'bar']]); $this->drupalGet('system-test/set-header', ['query' => ['name' => 'Foo', 'value' => 'bar']]);
$this->assertNull($this->drupalGetHeader('X-Drupal-Cache'), 'Caching was bypassed.'); $this->assertNull($this->drupalGetHeader('X-Drupal-Cache'), 'Caching was bypassed.');
$this->assertStringNotContainsString('cookie', $this->drupalGetHeader('Vary'), 'Vary: Cookie header was not sent.', TRUE); $this->assertStringNotContainsStringIgnoringCase('cookie', $this->drupalGetHeader('Vary'), 'Vary: Cookie header was not sent.');
$this->assertEqual($this->drupalGetHeader('Cache-Control'), 'must-revalidate, no-cache, private', 'Cache-Control header was sent.'); $this->assertEqual($this->drupalGetHeader('Cache-Control'), 'must-revalidate, no-cache, private', 'Cache-Control header was sent.');
$this->assertEqual($this->drupalGetHeader('Expires'), 'Sun, 19 Nov 1978 05:00:00 GMT', 'Expires header was sent.'); $this->assertEqual($this->drupalGetHeader('Expires'), 'Sun, 19 Nov 1978 05:00:00 GMT', 'Expires header was sent.');
$this->assertEqual($this->drupalGetHeader('Foo'), 'bar', 'Custom header was sent.'); $this->assertEqual($this->drupalGetHeader('Foo'), 'bar', 'Custom header was sent.');
...@@ -441,13 +441,13 @@ public function testPageCacheWithoutVaryCookie() { ...@@ -441,13 +441,13 @@ public function testPageCacheWithoutVaryCookie() {
// Fill the cache. // Fill the cache.
$this->drupalGet(''); $this->drupalGet('');
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'MISS', 'Page was not cached.'); $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'MISS', 'Page was not cached.');
$this->assertStringNotContainsString('cookie', $this->drupalGetHeader('Vary'), 'Vary: Cookie header was not sent.', TRUE); $this->assertStringNotContainsStringIgnoringCase('cookie', $this->drupalGetHeader('Vary'), 'Vary: Cookie header was not sent.');
$this->assertEqual($this->drupalGetHeader('Cache-Control'), 'max-age=300, public', 'Cache-Control header was sent.'); $this->assertEqual($this->drupalGetHeader('Cache-Control'), 'max-age=300, public', 'Cache-Control header was sent.');
// Check cache. // Check cache.
$this->drupalGet(''); $this->drupalGet('');
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', 'Page was cached.'); $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', 'Page was cached.');
$this->assertStringNotContainsString('cookie', $this->drupalGetHeader('Vary'), 'Vary: Cookie header was not sent.', TRUE); $this->assertStringNotContainsStringIgnoringCase('cookie', $this->drupalGetHeader('Vary'), 'Vary: Cookie header was not sent.');
$this->assertEqual($this->drupalGetHeader('Cache-Control'), 'max-age=300, public', 'Cache-Control header was sent.'); $this->assertEqual($this->drupalGetHeader('Cache-Control'), 'max-age=300, public', 'Cache-Control header was sent.');
} }
......
...@@ -28,8 +28,6 @@ trait PHPUnit8Warnings { ...@@ -28,8 +28,6 @@ trait PHPUnit8Warnings {
'getObjectAttribute() is deprecated and will be removed in PHPUnit 9.', 'getObjectAttribute() is deprecated and will be removed in PHPUnit 9.',
'assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.', 'assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.',
'assertAttributeInstanceOf() is deprecated and will be removed in PHPUnit 9.', 'assertAttributeInstanceOf() is deprecated and will be removed in PHPUnit 9.',
'The optional $ignoreCase parameter of assertContains() is deprecated and will be removed in PHPUnit 9.',
'The optional $ignoreCase parameter of assertNotContains() is deprecated and will be removed in PHPUnit 9.',
]; ];
/** /**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment