function testTermDelete() {
$vocabulary = $this
->createVocabulary();
$valid_term = $this
->createTerm($vocabulary);
// Delete a valid term.
$valid_term
->delete();
$terms = entity_load_multiple_by_properties('taxonomy_term', array(
'vid' => $vocabulary
->id(),
));
$this
->assertTrue(empty($terms), 'Vocabulary is empty after deletion');
// Delete an invalid term. Should not throw any notices.
entity_delete_multiple('taxonomy_term', array(
42,
));
}