diff options
Diffstat (limited to 'modules/simpletest/simpletest.test')
-rw-r--r-- | modules/simpletest/simpletest.test | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/modules/simpletest/simpletest.test b/modules/simpletest/simpletest.test index dbe2ec0f3..c67b004ea 100644 --- a/modules/simpletest/simpletest.test +++ b/modules/simpletest/simpletest.test @@ -567,3 +567,91 @@ class SimpleTestBrokenSetUp extends DrupalWebTestCase { } } } + +/** + * Verifies that tests bundled with installation profile modules are found. + */ +class SimpleTestInstallationProfileModuleTestsTestCase extends DrupalWebTestCase { + /** + * Use the Testing profile. + * + * The Testing profile contains drupal_system_listing_compatible_test.test, + * which attempts to: + * - run tests using the Minimal profile (which does not contain the + * drupal_system_listing_compatible_test.module) + * - but still install the drupal_system_listing_compatible_test.module + * contained in the Testing profile. + * + * @see DrupalSystemListingCompatibleTestCase + */ + protected $profile = 'testing'; + + public static function getInfo() { + return array( + 'name' => 'Installation profile module tests', + 'description' => 'Verifies that tests bundled with installation profile modules are found.', + 'group' => 'SimpleTest', + ); + } + + function setUp() { + parent::setUp(array('simpletest')); + + $this->admin_user = $this->drupalCreateUser(array('administer unit tests')); + $this->drupalLogin($this->admin_user); + } + + /** + * Tests existence of test case located in an installation profile module. + */ + function testInstallationProfileTests() { + $this->drupalGet('admin/config/development/testing'); + $this->assertText('Installation profile module tests helper'); + $edit = array( + 'DrupalSystemListingCompatibleTestCase' => TRUE, + ); + $this->drupalPost(NULL, $edit, t('Run tests')); + $this->assertText('DrupalSystemListingCompatibleTestCase test executed.'); + } +} + +/** + * Verifies that tests in other installation profiles are not found. + * + * @see SimpleTestInstallationProfileModuleTestsTestCase + */ +class SimpleTestOtherInstallationProfileModuleTestsTestCase extends DrupalWebTestCase { + /** + * Use the Minimal profile. + * + * The Testing profile contains drupal_system_listing_compatible_test.test, + * which should not be found. + * + * @see SimpleTestInstallationProfileModuleTestsTestCase + * @see DrupalSystemListingCompatibleTestCase + */ + protected $profile = 'minimal'; + + public static function getInfo() { + return array( + 'name' => 'Other Installation profiles', + 'description' => 'Verifies that tests in other installation profiles are not found.', + 'group' => 'SimpleTest', + ); + } + + function setUp() { + parent::setUp(array('simpletest')); + + $this->admin_user = $this->drupalCreateUser(array('administer unit tests')); + $this->drupalLogin($this->admin_user); + } + + /** + * Tests that tests located in another installation profile do not appear. + */ + function testOtherInstallationProfile() { + $this->drupalGet('admin/config/development/testing'); + $this->assertNoText('Installation profile module tests helper'); + } +} |