function RendererLegacyTest::testTableDrag
Same name and namespace in other branches
- main core/tests/Drupal/KernelTests/Core/Render/RendererLegacyTest.php \Drupal\KernelTests\Core\Render\RendererLegacyTest::testTableDrag()
Tests deprecation of drupal_attach_tabledrag().
See also
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Render/ RendererLegacyTest.php, line 26
Class
- RendererLegacyTest
- Deprecation tests cases for the render layer.
Namespace
Drupal\KernelTests\Core\RenderCode
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.