Adds test for text metadata

This commit is contained in:
Rodrigo de Oliveira 2021-03-29 17:09:17 -03:00
parent 0686795afc
commit a50f878725
2 changed files with 5 additions and 2 deletions

View File

@ -50,6 +50,6 @@ class Text extends Metadata_Type {
} else {
$return = $this->make_clickable_links($value);
}
return $return;
return force_balance_tags($return);
}
}

View File

@ -305,9 +305,12 @@ class Item_Metadata extends TAINACAN_UnitTestCase {
$this->assertEquals($item_metadata_textarea->get_value_as_html(), $response_textarea);
// Poor HTML entry tests
$malformatted_HTML = "<p> I started my content <div> and make something else here </div> withou closing it properly";
$malformatted_HTML = "<p> I started my content <div> and make something else here </div> without closing its HTML properly";
$item_metadata_text->set_value($malformatted_HTML);
$item_metadata_textarea->set_value($malformatted_HTML);
$this->assertEquals($item_metadata_text->get_value_as_html(), $malformatted_HTML ."</p>");
$this->assertEquals($item_metadata_textarea->get_value_as_html(), $malformatted_HTML ."</p>");
}