Tests the functionality of the isChanged() function.
public function testIsChanged() {
// Create a paragraph.
$paragraph = Paragraph::create([
'title' => 'Paragraph',
'type' => 'text_paragraph',
'text' => 'Text Paragraph',
]);
$this
->assertTrue($paragraph
->isChanged(), 'The paragraph is a new entity.');
// Save the paragraph and assert no changes.
$paragraph
->save();
$this
->assertFalse($paragraph
->isChanged(), 'Paragraph::isChanged() found no changes after the entity has been saved.');
$paragraph
->set('text', 'New text');
$this
->assertTrue($paragraph
->isChanged(), 'Paragraph::isChanged() found changes after updating text field.');
}