'command' => 'remove',
'selector' => '#page-title',
];
$this->
assertEquals($expected,
$command->
render());
} /**
* @covers \Drupal\Core\Ajax\ReplaceCommand
*/
public function testReplaceCommand() { $command =
new ReplaceCommand('#page-title', '<p>New Text!</p>',
['my-setting' => 'setting'
]);
$expected =
[ 'command' => 'insert',
'method' => 'replaceWith',
'selector' => '#page-title',
'data' => '<p>New Text!</p>',
'settings' =>
['my-setting' => 'setting'
],
];
$this->
assertEquals($expected,
$command->
render());
}