当前位置: 首页>>代码示例>>PHP>>正文


PHP batch_test_stack函数代码示例

本文整理汇总了PHP中batch_test_stack函数的典型用法代码示例。如果您正苦于以下问题:PHP batch_test_stack函数的具体用法?PHP batch_test_stack怎么用?PHP batch_test_stack使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了batch_test_stack函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     batch_test_stack(NULL, TRUE);
     $function = '_batch_test_' . $form_state->getValue('batch');
     batch_set($function());
     $form_state->setRedirect('batch_test.redirect');
 }
开发者ID:sarahwillem,项目名称:OD8,代码行数:10,代码来源:BatchTestSimpleForm.php

示例2: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, array &$form_state)
 {
     batch_test_stack(NULL, TRUE);
     $function = '_batch_test_' . $form_state['values']['batch'];
     batch_set($function());
     $form_state['redirect_route'] = new Url('batch_test.redirect');
 }
开发者ID:alnutile,项目名称:drunatra,代码行数:10,代码来源:BatchTestSimpleForm.php

示例3: batchTestChainedFormSubmit4

 /**
  * Form submission handler #4 for batch_test_chained_form
  */
 public static function batchTestChainedFormSubmit4($form, FormStateInterface $form_state)
 {
     batch_test_stack('submit handler 4');
     batch_test_stack('value = ' . $form_state['values']['value']);
     $form_state['values']['value']++;
     batch_set(_batch_test_batch_3());
     $form_state->setRedirect('batch_test.redirect');
 }
开发者ID:anatalsceo,项目名称:en-classe,代码行数:11,代码来源:BatchTestChainedForm.php

示例4: batchTestChainedFormSubmit4

 /**
  * Form submission handler #4 for batch_test_chained_form
  */
 public static function batchTestChainedFormSubmit4($form, &$form_state)
 {
     batch_test_stack('submit handler 4');
     batch_test_stack('value = ' . $form_state['values']['value']);
     $form_state['values']['value']++;
     batch_set(_batch_test_batch_3());
     $form_state['redirect_route'] = new Url('batch_test.redirect');
 }
开发者ID:alnutile,项目名称:drunatra,代码行数:11,代码来源:BatchTestChainedForm.php

示例5: testBatchProgressPageTitle

 /**
  * Tests that the batch API progress page shows the title correctly.
  */
 function testBatchProgressPageTitle()
 {
     // Visit an administrative page that runs a test batch, and check that the
     // title shown during batch execution (which the batch callback function
     // saved as a variable) matches the theme used on the administrative page.
     $this->drupalGet('batch-test/test-title');
     // The stack should contain the title shown on the progress page.
     $this->assertEqual(batch_test_stack(), ['Batch Test'], 'The batch title is shown on the batch page.');
     $this->assertText('Redirection successful.', 'Redirection after batch execution is correct.');
 }
开发者ID:nstielau,项目名称:drops-8,代码行数:13,代码来源:PageTest.php

示例6: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     batch_test_stack(NULL, TRUE);
     switch ($form_state['storage']['step']) {
         case 1:
             batch_set(_batch_test_batch_1());
             break;
         case 2:
             batch_set(_batch_test_batch_2());
             break;
     }
     if ($form_state['storage']['step'] < 2) {
         $form_state['storage']['step']++;
         $form_state['rebuild'] = TRUE;
     }
     $form_state->setRedirect('batch_test.redirect');
 }
开发者ID:anatalsceo,项目名称:en-classe,代码行数:20,代码来源:BatchTestMultiStepForm.php

示例7: testBatchProgressPageTheme

 /**
  * Tests that the batch API progress page uses the correct theme.
  */
 function testBatchProgressPageTheme()
 {
     // Make sure that the page which starts the batch (an administrative page)
     // is using a different theme than would normally be used by the batch API.
     $this->container->get('theme_handler')->install(array('seven', 'bartik'));
     $this->container->get('config.factory')->get('system.theme')->set('default', 'bartik')->set('admin', 'seven')->save();
     // Log in as an administrator who can see the administrative theme.
     $admin_user = $this->drupalCreateUser(array('view the administration theme'));
     $this->drupalLogin($admin_user);
     // Visit an administrative page that runs a test batch, and check that the
     // theme that was used during batch execution (which the batch callback
     // function saved as a variable) matches the theme used on the
     // administrative page.
     $this->drupalGet('admin/batch-test/test-theme');
     // The stack should contain the name of the theme used on the progress
     // page.
     $this->assertEqual(batch_test_stack(), array('seven'), 'A progressive batch correctly uses the theme of the page that started the batch.');
 }
开发者ID:davidsoloman,项目名称:drupalconsole.com,代码行数:21,代码来源:PageTest.php

示例8: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     batch_test_stack(NULL, TRUE);
     $step = $form_state->get('step');
     switch ($step) {
         case 1:
             batch_set(_batch_test_batch_1());
             break;
         case 2:
             batch_set(_batch_test_batch_2());
             break;
     }
     if ($step < 2) {
         $form_state->set('step', ++$step);
         $form_state->setRebuild();
     }
     $form_state->setRedirect('batch_test.redirect');
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:21,代码来源:BatchTestMultiStepForm.php

示例9: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, array &$form_state)
 {
     batch_test_stack('mock form submitted with value = ' . $form_state['values']['test_value']);
 }
开发者ID:alnutile,项目名称:drunatra,代码行数:7,代码来源:BatchTestMockForm.php

示例10: testBatchLargePercentage

 /**
  * Tests batches that return $context['finished'] > 1 do in fact complete.
  *
  * @see https://www.drupal.org/node/600836
  */
 function testBatchLargePercentage()
 {
     // Displaying the page triggers batch 5.
     $this->drupalGet('batch-test/large-percentage');
     $this->assertBatchMessages($this->_resultMessages('batch_5'), 'Batch for step 2 performed successfully.');
     $this->assertEqual(batch_test_stack(), $this->_resultStack('batch_5'), 'Execution order was correct.');
     $this->assertText('Redirection successful.', 'Redirection after batch execution is correct.');
 }
开发者ID:nsp15,项目名称:Drupal8,代码行数:13,代码来源:ProcessingTest.php

示例11: testTitleBatch

 /**
  * Runs a batch for testing the title shown on the progress page.
  *
  * @return \Symfony\Component\HttpFoundation\RedirectResponse|null
  *   A redirect response if the batch is progressive. No return value otherwise.
  */
 public function testTitleBatch()
 {
     batch_test_stack(NULL, TRUE);
     $batch = ['title' => 'Batch Test', 'operations' => [['_batch_test_title_callback', []]]];
     batch_set($batch);
     return batch_process('batch-test/redirect');
 }
开发者ID:nstielau,项目名称:drops-8,代码行数:13,代码来源:BatchTestController.php

示例12: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     batch_test_stack('mock form submitted with value = ' . $form_state->getValue('test_value'));
 }
开发者ID:318io,项目名称:318-io,代码行数:7,代码来源:BatchTestMockForm.php

示例13: testThemeBatch

 /**
  * Runs a batch for testing theme used on the progress page.
  *
  * @return \Symfony\Component\HttpFoundation\RedirectResponse|null
  *   A redirect response if the batch is progressive. No return value otherwise.
  */
 public function testThemeBatch()
 {
     batch_test_stack(NULL, TRUE);
     $batch = array('operations' => array(array('_batch_test_theme_callback', array())));
     batch_set($batch);
     return batch_process('batch-test/redirect');
 }
开发者ID:davidsoloman,项目名称:drupalconsole.com,代码行数:13,代码来源:BatchTestController.php


注:本文中的batch_test_stack函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。