Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / simpletest / tests / modules / simpletest_test / simpletest_test.install
1 <?php
2
3 /**
4  * @file
5  * Install hooks for test module.
6  */
7
8 use Drupal\entity_test\Entity\EntityTest;
9
10 /**
11  * Implements hook_install().
12  */
13 function simpletest_test_install() {
14   $total = 2;
15   $operations = [];
16   for ($i = 1; $i <= $total; $i++) {
17     $operations[] = ['_simpletest_test_callback', [$i]];
18   }
19   $batch = [
20     'operations' => $operations,
21   ];
22   batch_set($batch);
23   $batch =& batch_get();
24   $batch['progressive'] = FALSE;
25   batch_process();
26 }
27
28 /**
29  * Callback for batch operations.
30  */
31 function _simpletest_test_callback($id) {
32   $entity = EntityTest::create(['id' => $id]);
33   $entity->save();
34 }