Commit 206e2b25 authored by webchick's avatar webchick

Issue #2072941 by marcingy, tim.plunkett: Modernize block.module forms.

parent d6693eb3
......@@ -18,7 +18,7 @@ class BlockDeleteForm extends EntityConfirmFormBase {
* {@inheritdoc}
*/
public function getQuestion() {
return t('Are you sure you want to delete the block %name?', array('%name' => $this->entity->label()));
return $this->t('Are you sure you want to delete the block %name?', array('%name' => $this->entity->label()));
}
/**
......@@ -32,7 +32,7 @@ public function getCancelPath() {
* {@inheritdoc}
*/
public function getConfirmText() {
return t('Delete');
return $this->t('Delete');
}
/**
......@@ -40,7 +40,7 @@ public function getConfirmText() {
*/
public function submit(array $form, array &$form_state) {
$this->entity->delete();
drupal_set_message(t('The block %name has been removed.', array('%name' => $this->entity->label())));
drupal_set_message($this->t('The block %name has been removed.', array('%name' => $this->entity->label())));
$form_state['redirect'] = 'admin/structure/block';
}
......
......@@ -78,7 +78,11 @@ public function testGetUniqueMachineName() {
->method('getStorageController')
->will($this->returnValue($block_storage));
$block_form_controller = new BlockFormController($entity_manager, $query_factory);
$language_manager = $this->getMockBuilder('Drupal\Core\Language\LanguageManager')
->disableOriginalConstructor()
->getMock();
$block_form_controller = new BlockFormController($entity_manager, $query_factory, $language_manager);
// Ensure that the block with just one other instance gets the next available
// name suggestion.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment