Commit e2184e25 authored by Dries's avatar Dries

- Patch #464714 by chx, DamZ: speed up the tests by bringing unit tests backt...

- Patch #464714 by chx, DamZ: speed up the tests by bringing unit tests backt to live.  Unit tests bootstrap faster and have the potential to speed up testing. We'll need help converting tests where possible.
parent a36d0d49
This diff is collapsed.
......@@ -238,7 +238,7 @@ function simpletest_get_all_tests() {
}
$classes = array_values(array_diff(get_declared_classes(), $existing_classes));
foreach ($classes as $key => $class) {
if (!method_exists($class, 'getInfo')) {
if (!is_subclass_of($class, 'DrupalTestCase') || !method_exists($class, 'getInfo')) {
unset($classes[$key]);
}
}
......
......@@ -199,7 +199,6 @@ class SimpleTestFunctionalTest extends DrupalWebTestCase {
*/
function getTestResults() {
$results = array();
if ($this->parse()) {
if ($fieldset = $this->getResultFieldSet()) {
// Code assumes this is the only test in group.
......
......@@ -4,7 +4,7 @@
/**
* Tests for the l() function.
*/
class CommonLUnitTest extends DrupalWebTestCase {
class CommonLUnitTest extends DrupalUnitTestCase {
public static function getInfo() {
return array(
......@@ -26,7 +26,7 @@ class CommonLUnitTest extends DrupalWebTestCase {
}
}
class CommonSizeTestCase extends DrupalWebTestCase {
class CommonSizeTestCase extends DrupalUnitTestCase {
protected $exact_test_cases;
protected $rounded_test_cases;
......@@ -631,7 +631,7 @@ class DrupalRenderUnitTestCase extends DrupalWebTestCase {
/**
* Test for valid_url().
*/
class ValidUrlTestCase extends DrupalWebTestCase {
class ValidUrlTestCase extends DrupalUnitTestCase {
public static function getInfo() {
return array(
'name' => t('Valid Url'),
......
......@@ -77,7 +77,7 @@ class FormsTestCase extends DrupalWebTestCase {
/**
* Test form type functions for expected behavior.
*/
class FormsTestTypeCase extends DrupalWebTestCase {
class FormsTestTypeCase extends DrupalUnitTestCase {
public static function getInfo() {
return array(
'name' => t('Form type-specific tests'),
......
......@@ -9,7 +9,7 @@
/**
* Unit tests for the graph handling features.
*/
class GraphUnitTest extends DrupalWebTestCase {
class GraphUnitTest extends DrupalUnitTestCase {
public static function getInfo() {
return array(
'name' => t('Graph'),
......
......@@ -135,7 +135,7 @@ CONTENTS;
}
class RegistrySkipBodyTestCase extends DrupalWebTestCase {
class RegistrySkipBodyTestCase extends DrupalUnitTestCase {
public static function getInfo() {
return array(
'name' => t('Skip function body test'),
......@@ -148,6 +148,7 @@ class RegistrySkipBodyTestCase extends DrupalWebTestCase {
// This string contains all three kinds of opening braces.
$function = '<?php function foo () { $x = "{$y}"; $x = "${y}"; }';
$tokens = token_get_all($function);
require_once DRUPAL_ROOT . '/includes/registry.inc';
_registry_skip_body($tokens);
// Consume the last }
each($tokens);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment