Test crud operations of translators.
function testTranslators() {
$translator = $this
->createTranslator();
$loaded_translator = Translator::load($translator
->id());
$this
->assertEquals($translator
->id(), $loaded_translator
->id());
$this
->assertEquals($translator
->label(), $loaded_translator
->label());
$this
->assertEquals($translator
->getSettings(), $loaded_translator
->getSettings());
// Update the settings.
$translator
->setSetting('new_key', $this
->randomString());
$translator
->save();
$loaded_translator = Translator::load($translator
->id());
$this
->assertEquals($translator
->id(), $loaded_translator
->id());
$this
->assertEquals($translator
->label(), $loaded_translator
->label());
$this
->assertEquals($translator
->getSettings(), $loaded_translator
->getSettings());
// Delete the translator, make sure the translator is gone.
$translator
->delete();
$this
->assertNull(Translator::load($translator
->id()));
}