Commit 577949ff authored by alexpott's avatar alexpott
Browse files

Issue #2002434 by sillygwailo: Rename Views method create_view() to createView().

parent 93e80155
...@@ -55,6 +55,6 @@ public function validateView(array $form, array &$form_state); ...@@ -55,6 +55,6 @@ public function validateView(array $form, array &$form_state);
* *
* @throws Drupal\views\Plugin\views\wizard\WizardException * @throws Drupal\views\Plugin\views\wizard\WizardException
*/ */
function create_view(array $form, array &$form_state); public function createView(array $form, array &$form_state);
} }
...@@ -1161,12 +1161,12 @@ public function validateView(array $form, array &$form_state) { ...@@ -1161,12 +1161,12 @@ public function validateView(array $form, array &$form_state) {
} }
/** /**
* Implements Drupal\views\Plugin\views\wizard\WizardInterface::create_view(). * {@inheritDoc}
*/ */
function create_view(array $form, array &$form_state) { public function createView(array $form, array &$form_state) {
$view = $this->retrieveValidatedView($form, $form_state); $view = $this->retrieveValidatedView($form, $form_state);
if (empty($view)) { if (empty($view)) {
throw new WizardException('Attempted to create_view with values that have not been validated.'); throw new WizardException('Attempted to create a view with values that have not been validated.');
} }
return $view; return $view;
} }
......
...@@ -80,7 +80,7 @@ public function testCreateView() { ...@@ -80,7 +80,7 @@ public function testCreateView() {
); );
$this->wizard->validateView($form, $form_state); $this->wizard->validateView($form, $form_state);
$view = $this->wizard->create_view($form, $form_state); $view = $this->wizard->createView($form, $form_state);
$this->assertTrue($view instanceof ViewUI, 'The created view is a ViewUI object.'); $this->assertTrue($view instanceof ViewUI, 'The created view is a ViewUI object.');
$this->assertEqual($view->get('id'), $random_id); $this->assertEqual($view->get('id'), $random_id);
$this->assertEqual($view->get('label'), $random_label); $this->assertEqual($view->get('label'), $random_label);
......
...@@ -194,7 +194,7 @@ public function validate(array $form, array &$form_state) { ...@@ -194,7 +194,7 @@ public function validate(array $form, array &$form_state) {
*/ */
public function submit(array $form, array &$form_state) { public function submit(array $form, array &$form_state) {
try { try {
$view = $form_state['wizard_instance']->create_view($form, $form_state); $view = $form_state['wizard_instance']->createView($form, $form_state);
} }
// @todo Figure out whether it really makes sense to throw and catch exceptions on the wizard. // @todo Figure out whether it really makes sense to throw and catch exceptions on the wizard.
catch (WizardException $e) { catch (WizardException $e) {
......
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