You are here

protected function SimpleTestFunctionalTest::testWebTestRunner in SimpleTest 7.2

Same name and namespace in other branches
  1. 6.2 simpletest.test \SimpleTestFunctionalTest::testWebTestRunner()
  2. 7 simpletest.test \SimpleTestFunctionalTest::testWebTestRunner()

Make sure that tests selected through the web interface are run and that the results are displayed correctly.

File

./simpletest.test, line 123
Tests for simpletest.module.

Class

SimpleTestFunctionalTest
@file Tests for simpletest.module.

Code

protected function testWebTestRunner() {
  $this->pass = t('SimpleTest pass.');
  $this->fail = t('SimpleTest fail.');
  $this->valid_permission = 'access content';
  $this->invalid_permission = 'invalid permission';
  if ($this
    ->inCURL()) {

    // Only run following code if this test is running itself through a CURL request.
    $this
      ->stubTest();
  }
  else {

    // Run twice so test_ids can be accumulated.
    for ($i = 0; $i < 2; $i++) {

      // Run this test from web interface.
      $this
        ->drupalGet('admin/config/development/testing');
      $edit = array();
      $edit['SimpleTestFunctionalTest'] = TRUE;
      $this
        ->drupalPost(NULL, $edit, t('Run tests'));

      // Parse results and confirm that they are correct.
      $this
        ->getTestResults();
      $this
        ->confirmStubTestResults();
    }

    // Regression test for #290316.
    // Check that test_id is incrementing.
    $this
      ->assertTrue($this->test_ids[0] != $this->test_ids[1], t('Test ID is incrementing.'));
  }
}