Mercurial > hg > cmmr2012-drupal-site
annotate core/modules/simpletest/src/Tests/SimpleTestInstallBatchTest.php @ 0:c75dbcec494b
Initial commit from drush-created site
author | Chris Cannam |
---|---|
date | Thu, 05 Jul 2018 14:24:15 +0000 |
parents | |
children | 12f9dff5fda9 |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 namespace Drupal\simpletest\Tests; |
Chris@0 | 4 |
Chris@0 | 5 use Drupal\entity_test\Entity\EntityTest; |
Chris@0 | 6 use Drupal\simpletest\WebTestBase; |
Chris@0 | 7 |
Chris@0 | 8 /** |
Chris@0 | 9 * Tests batch operations during tests execution. |
Chris@0 | 10 * |
Chris@0 | 11 * This demonstrates that a batch will be successfully executed during module |
Chris@0 | 12 * installation when running tests. |
Chris@0 | 13 * |
Chris@0 | 14 * @group simpletest |
Chris@0 | 15 */ |
Chris@0 | 16 class SimpleTestInstallBatchTest extends WebTestBase { |
Chris@0 | 17 |
Chris@0 | 18 /** |
Chris@0 | 19 * Modules to enable. |
Chris@0 | 20 * |
Chris@0 | 21 * @var array |
Chris@0 | 22 */ |
Chris@0 | 23 public static $modules = ['simpletest', 'simpletest_test', 'entity_test']; |
Chris@0 | 24 |
Chris@0 | 25 /** |
Chris@0 | 26 * Tests loading entities created in a batch in simpletest_test_install(). |
Chris@0 | 27 */ |
Chris@0 | 28 public function testLoadingEntitiesCreatedInBatch() { |
Chris@0 | 29 $entity1 = EntityTest::load(1); |
Chris@0 | 30 $this->assertNotNull($entity1, 'Successfully loaded entity 1.'); |
Chris@0 | 31 $entity2 = EntityTest::load(2); |
Chris@0 | 32 $this->assertNotNull($entity2, 'Successfully loaded entity 2.'); |
Chris@0 | 33 } |
Chris@0 | 34 |
Chris@0 | 35 } |