EntityEditWizardTest.php in Chaos Tool Suite (ctools) 8.3
File
tests/modules/ctools_wizard_test/src/Wizard/EntityEditWizardTest.php
View source
<?php
namespace Drupal\ctools_wizard_test\Wizard;
use Drupal\ctools\Wizard\EntityFormWizardBase;
class EntityEditWizardTest extends EntityFormWizardBase {
public function getWizardLabel() {
return $this
->t('Example entity');
}
public function getMachineLabel() {
return $this
->t('Label');
}
public function getEntityType() {
return 'ctools_wizard_test_config_entity';
}
public function exists() {
return '\\Drupal\\ctools_wizard_test\\Entity\\ExampleConfigEntity::load';
}
public function getOperations($cached_values) {
$config_entity = $cached_values['ctools_wizard_test_config_entity'];
$steps = [
'general' => [
'form' => 'Drupal\\ctools_wizard_test\\Form\\ExampleConfigEntityGeneralForm',
'title' => $this
->t('General'),
],
'one' => [
'form' => 'Drupal\\ctools_wizard_test\\Form\\ExampleConfigEntityOneForm',
'title' => $this
->t('Form One'),
],
'two' => [
'form' => 'Drupal\\ctools_wizard_test\\Form\\ExampleConfigEntityTwoForm',
'title' => $this
->t('Form Two'),
],
];
if (!empty($config_entity) && !$config_entity
->isNew()) {
$steps['existing'] = [
'form' => 'Drupal\\ctools_wizard_test\\Form\\ExampleConfigEntityExistingForm',
'title' => $this
->t('Existing entity'),
];
}
return $steps;
}
}