function BrokenSetUpTest::testBreakSetUp

Runs this test case from within the simpletest child site.

File

drupal/core/modules/simpletest/lib/Drupal/simpletest/Tests/BrokenSetUpTest.php, line 68
Definition of Drupal\simpletest\Tests\BrokenSetUpTest.

Class

BrokenSetUpTest
Tests a test case that does not run parent::setUp() in its setUp() method.

Namespace

Drupal\simpletest\Tests

Code

function testBreakSetUp() {

  // If the test is being run from the main site, run it again from the web
  // interface within the simpletest child site.
  if (!drupal_valid_test_ua()) {
    $edit['Drupal\\simpletest\\Tests\\BrokenSetUpTest'] = TRUE;
    $this
      ->drupalPost('admin/config/development/testing', $edit, t('Run tests'));

    // Verify that the broken test and its tearDown() method are skipped.
    $this
      ->assertRaw(t('The test setUp() method has been run.'));
    $this
      ->assertRaw(t('The test cannot be executed because it has not been set up properly.'));
    $this
      ->assertNoRaw(t('The test method has run.'));
    $this
      ->assertNoRaw(t('The tearDown() method has run.'));
  }
  else {
    $this
      ->pass(t('The test method has run.'));
  }
}