1.20.x simpletest.test protected SimpleTestMissingCheckedRequirements::testCheckRequirements()

Ensures test will not run when requirements are missing.

File

modules/simpletest/tests/simpletest.test, line 556
Tests for simpletest.module.

Class

SimpleTestMissingCheckedRequirements
Tests missing requirements to run test.

Code

protected function testCheckRequirements() {
  // If this is the main request, run the web test script and then assert
  // that the child tests did not run.
  if (!backdrop_valid_test_ua()) {
    // Run this test from web interface.
    $edit['tests[SimpleTestMissingCheckedRequirements]'] = TRUE;
    $this->backdropPost('admin/config/development/testing', $edit, t('Run tests'));
    $this->assertRaw('Test is not allowed to run.', 'Test check for requirements came up.');
    $this->assertNoText('Test ran when it failed requirements check.', 'Test requirements stopped test from running.');
  }
  else {
    $this->fail('Test ran when it failed requirements check.');
  }
}