Commit 802d1e4f authored by larowlan's avatar larowlan

Issue #3007371 by Lendude: System: Convert remaining Render functional tests to phpunit

parent 9c98f292
<?php
namespace Drupal\system\Tests\Render;
namespace Drupal\Tests\system\Functional\Render;
use Drupal\simpletest\WebTestBase;
use Drupal\Tests\BrowserTestBase;
/**
* Functional tests for HtmlResponseAttachmentsProcessor.
*
* @group Render
*/
class HtmlResponseAttachmentsTest extends WebTestBase {
class HtmlResponseAttachmentsTest extends BrowserTestBase {
/**
* Modules to enable.
......@@ -61,7 +61,7 @@ public function testAttachments() {
'</foo?bar=&lt;baz&gt;&amp;baz=false>; rel="alternate"',
'</foo/bar>; hreflang="nl"; rel="alternate"',
];
$this->assertEqual($this->drupalGetHeader('link'), implode(',', $expected_link_headers));
$this->assertEqual($this->getSession()->getResponseHeaders()['Link'], $expected_link_headers);
}
/**
......@@ -93,9 +93,10 @@ public function testRenderCachedBlock() {
* Helper function to make assertions about added HTTP headers.
*/
protected function assertTeapotHeaders() {
$this->assertHeader('X-Test-Teapot', 'Teapot Mode Active');
$this->assertHeader('X-Test-Teapot-Replace', 'Teapot replaced');
$this->assertHeader('X-Test-Teapot-No-Replace', 'This value is not replaced,This one is added');
$headers = $this->getSession()->getResponseHeaders();
$this->assertEquals($headers['X-Test-Teapot'], ['Teapot Mode Active']);
$this->assertEquals($headers['X-Test-Teapot-Replace'], ['Teapot replaced']);
$this->assertEquals($headers['X-Test-Teapot-No-Replace'], ['This value is not replaced', 'This one is added']);
}
/**
......@@ -117,8 +118,8 @@ protected function assertFeed() {
$this->fail('Unable to find feed link.');
}
else {
foreach ($test_meta->attributes() as $attribute => $value) {
$this->assertEqual($value, $test_meta_attributes[$attribute]);
foreach ($test_meta_attributes as $attribute => $value) {
$this->assertEquals($value, $test_meta->getAttribute($attribute));
}
}
}
......@@ -136,8 +137,7 @@ protected function assertHead() {
$this->fail('Unable to find the head meta.');
}
else {
$test_meta_attributes = $test_meta->attributes();
$this->assertEqual($test_meta_attributes['test-attribute'], 'testvalue');
$this->assertEqual($test_meta->getAttribute('test-attribute'), 'testvalue');
}
}
......
<?php
namespace Drupal\system\Tests\Render;
namespace Drupal\Tests\system\Functional\Render;
use Drupal\Core\Url;
use Drupal\simpletest\WebTestBase;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\system\Functional\Cache\AssertPageCacheContextsAndTagsTrait;
/**
* Tests that URL bubbleable metadata is correctly bubbled.
*
* @group Render
*/
class UrlBubbleableMetadataBubblingTest extends WebTestBase {
class UrlBubbleableMetadataBubblingTest extends BrowserTestBase {
use AssertPageCacheContextsAndTagsTrait;
/**
* Modules to enable.
......@@ -24,7 +27,6 @@ class UrlBubbleableMetadataBubblingTest extends WebTestBase {
*/
protected function setUp() {
parent::setUp();
$this->dumpHeaders = TRUE;
}
/**
......
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