Tests the translation publishing status.
protected function assertPublishedStatus() {
$entity = entity_load($this->entityType, $this->entityId, TRUE);
$path = $this->controller
->getEditPath($entity);
// Unpublish translations.
foreach ($this->langcodes as $index => $langcode) {
if ($index > 0) {
$edit = array(
'translation_entity[status]' => FALSE,
);
$this
->drupalPost($langcode . '/' . $path, $edit, $this
->getFormSubmitAction($entity));
$entity = entity_load($this->entityType, $this->entityId, TRUE);
$this
->assertFalse($entity->translation[$langcode]['status'], 'The translation has been correctly unpublished.');
}
}
// Check that the last published translation cannot be unpublished.
$this
->drupalGet($path);
$this
->assertFieldByXPath('//input[@name="translation_entity[status]" and @disabled="disabled"]', TRUE, 'The last translation is published and cannot be unpublished.');
}