diff --git a/core/modules/system/tests/modules/batch_test/batch_test.module b/core/modules/system/tests/modules/batch_test/batch_test.module index 6c558db..689b863 100644 --- a/core/modules/system/tests/modules/batch_test/batch_test.module +++ b/core/modules/system/tests/modules/batch_test/batch_test.module @@ -41,6 +41,47 @@ function batch_test_menu() { 'type' => MENU_LOCAL_TASK, 'weight' => 2, ); + // Programmatic form: the page submits the 'Chained' form through + // drupal_form_submit(). + $items['batch-test/programmatic'] = array( + 'title' => 'Programmatic', + 'route_name' => 'batch_test_programmatic', + 'type' => MENU_LOCAL_TASK, + 'weight' => 3, + ); + // No form: fire a batch simply by accessing a page. + $items['batch-test/no-form'] = array( + 'title' => 'Simple page', + 'route_name' => 'batch_test_no_form', + 'type' => MENU_LOCAL_TASK, + 'weight' => 4, + ); + // No form: fire a batch; return > 100% complete + $items['batch-test/large-percentage'] = array( + 'title' => 'Simple page with batch over 100% complete', + 'route_name' => 'batch_test_large_percentage', + 'type' => MENU_LOCAL_TASK, + 'weight' => 5, + ); + // Tests programmatic form submission within a batch operation. + $items['batch-test/nested-programmatic'] = array( + 'title' => 'Nested programmatic', + 'route_name' => 'batch_test_nested_programmatic', + 'type' => MENU_LOCAL_TASK, + 'weight' => 6, + ); + // Landing page to test redirects. + $items['batch-test/redirect'] = array( + 'title' => 'Redirect', + 'route_name' => 'batch_test_redirect', + 'type' => MENU_LOCAL_TASK, + 'weight' => 7, + ); + // This item lives under 'admin' so that the page uses the admin theme. + $items['admin/batch-test/test-theme'] = array( + 'route_name' => 'batch_test_test_theme', + 'type' => MENU_CALLBACK, + ); return $items; } diff --git a/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Controller/BatchTestController.php b/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Controller/BatchTestController.php index a1e7f15..405e88d 100644 --- a/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Controller/BatchTestController.php +++ b/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Controller/BatchTestController.php @@ -98,4 +98,5 @@ public function testThemeBatch() { batch_set($batch); return batch_process('batch-test/redirect'); } + }