'html', 'name' => 'Html', 'id' => 'html', 'unique' => '1', 'static' => '0', 'params' => [ 'nl2br' => '1', 'text' => "line1\nline2", ], 'position' => '1', ]; public function _before() { parent::_before(); $this->html = new Html( $this->diContainer->get(BlockRendererHelper::class), $this->diContainer->get(WPFunctions::class) ); } public function testItSanitisesHtml(): void { $block = $this->block; $block['params']['text'] = '

Hello

'; $html = $this->html->render($block, []); verify($html)->equals("

Hello

"); } public function testItSanitisesClassName(): void { $block = $this->block; $block['params']['class_name'] = 'my_clas"s1 class2'; $block['params']['text'] = 'line1'; $html = $this->html->render($block, []); verify($html)->equals("
line1
"); } }