$available_actions =
[ 'media_delete_action',
'media_publish_action',
'media_save_action',
'media_unpublish_action',
];
foreach ($available_actions as $action_name) { $assert_session->
optionExists('action',
$action_name);
} // Test unpublishing in bulk.
$page->
checkField('media_bulk_form[0]'
);
$page->
checkField('media_bulk_form[1]'
);
$page->
checkField('media_bulk_form[2]'
);
$page->
selectFieldOption('action', 'media_unpublish_action'
);
$page->
pressButton('Apply to selected items'
);
$assert_session->
pageTextContains('Unpublish media was applied to 3 items'
);
$this->
assertFalse($this->storage->
loadUnchanged(1
)->
isPublished(), 'The unpublish action failed in some of the media items.'
);
$this->
assertFalse($this->storage->
loadUnchanged(2
)->
isPublished(), 'The unpublish action failed in some of the media items.'
);
$this->
assertFalse($this->storage->
loadUnchanged(3
)->
isPublished(), 'The unpublish action failed in some of the media items.'
);
// Test publishing in bulk.
$page->
checkField('media_bulk_form[0]'
);