function CKEditorTest::testConstructorDeprecation
@deprecationMessage Calling CKEditor::__construct() without the $state argument is deprecated in drupal:8.8.0. The $state argument is required in drupal:9.0.0. See https://www.drupal.org/node/3075102. @group legacy
File
-
core/
modules/ ckeditor/ tests/ src/ Kernel/ CKEditorTest.php, line 512
Class
- CKEditorTest
- Tests for the 'CKEditor' text editor plugin.
Namespace
Drupal\Tests\ckeditor\KernelCode
public function testConstructorDeprecation() {
$editor = new CKEditor([], 'test', [
'provider' => 'test',
], $this->container
->get('plugin.manager.ckeditor.plugin'), $this->container
->get('module_handler'), $this->container
->get('language_manager'), $this->container
->get('renderer'));
// Ensure the BC layer injects the correct object.
$reflection_object = new \ReflectionObject($editor);
$reflection_property = $reflection_object->getProperty('state');
$reflection_property->setAccessible(TRUE);
$this->assertSame($reflection_property->getValue($editor), $this->container
->get('state'));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.