class RendererLegacyTest
Same name and namespace in other branches
- 8.9.x core/tests/Drupal/KernelTests/Core/Render/RendererLegacyTest.php \Drupal\KernelTests\Core\Render\RendererLegacyTest
- 11.x core/tests/Drupal/KernelTests/Core/Render/RendererLegacyTest.php \Drupal\KernelTests\Core\Render\RendererLegacyTest
Deprecation tests cases for the render layer.
Attributes
#[Group('legacy')]
#[RunTestsInSeparateProcesses]
#[IgnoreDeprecations]
Hierarchy
- class \Drupal\Tests\DrupalTestCase uses \Drupal\Tests\DrupalTestCaseTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\KernelTests\KernelTestBase implements \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Prophecy\PhpUnit\ProphecyTrait, \Drupal\Tests\BrowserHtmlDebugTrait, \Drupal\Tests\HttpKernelUiHelperTrait extends \Drupal\Tests\DrupalTestCase
- class \Drupal\KernelTests\Core\Render\RendererLegacyTest extends \Drupal\KernelTests\KernelTestBase
- class \Drupal\KernelTests\KernelTestBase implements \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Prophecy\PhpUnit\ProphecyTrait, \Drupal\Tests\BrowserHtmlDebugTrait, \Drupal\Tests\HttpKernelUiHelperTrait extends \Drupal\Tests\DrupalTestCase
Expanded class hierarchy of RendererLegacyTest
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Render/ RendererLegacyTest.php, line 16
Namespace
Drupal\KernelTests\Core\RenderView source
class RendererLegacyTest extends KernelTestBase {
/**
* Tests deprecation of drupal_attach_tabledrag().
*
* @see drupal_attach_tabledrag()
*/
public function testTableDrag() : void {
$this->expectUserDeprecationMessage('drupal_attach_tabledrag() is deprecated in drupal:11.5.0 and is removed from drupal:13.0.0. Use \\Drupal\\Core\\Render\\Element\\Table::attachTabledrag() instead. See https://www.drupal.org/node/3035565');
$elements = [];
$options = [
'table_id' => 'test-table',
'action' => 'match',
'relationship' => 'sibling',
'group' => 'test',
];
drupal_attach_tabledrag($elements, $options);
$expected = [];
Table::attachTabledrag($expected, $options);
$this->assertSame($expected['#attached']['drupalSettings']['tableDrag']['test-table']['test'][1], $elements['#attached']['drupalSettings']['tableDrag']['test-table']['test'][0]);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.