Overrides \Drupal\translation_entity\Tests\EntityTranslationUITest::assertPublishedStatus().
Overrides EntityTranslationUITest::assertPublishedStatus
protected function assertPublishedStatus() {
$entity = entity_load($this->entityType, $this->entityId, TRUE);
$path = $this->controller
->getEditPath($entity);
$languages = language_list();
$actions = array(
array(
t('Save and publish'),
t('Save and keep published'),
),
array(
t('Save and unpublish'),
t('Save and keep unpublished'),
),
);
foreach ($actions as $index => $status_actions) {
// (Un)publish the node translations and check that the translation
// statuses are (un)published accordingly.
foreach ($this->langcodes as $langcode) {
if (!empty($status_actions)) {
$action = array_shift($status_actions);
}
$this
->drupalPost($path, array(), $action, array(
'language' => $languages[$langcode],
));
}
$entity = entity_load($this->entityType, $this->entityId, TRUE);
foreach ($this->langcodes as $langcode) {
// The node is created as unpulished thus we switch to the published
// status first.
$status = !$index;
$this
->assertEqual($status, $entity->translation[$langcode]['status'], 'The translation has been correctly unpublished.');
}
}
}