Spinning out from #1593058: Remove system.info's files[] entry.

Obvious examples would be cache or queue subsystems.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

catch’s picture

Title: Allow stuff in core/Drupal to ship with tests » Allow stuff in core/lib/Drupal to ship with tests
sun’s picture

Status: Active » Needs review
Issue tags: +Testing system, +PSR-0
FileSize
2.31 KB

Hacky, but should get you started.

yurtboy’s picture

Status: Needs review » Reviewed & tested by the community

The patch applied with no issues.
Not sure how to test it though from a user standpoint?

sun’s picture

Status: Reviewed & tested by the community » Needs work

This patch is a total hack. ;) Needs polishing first.

RobLoach’s picture

Berdir’s picture

+++ b/core/lib/Drupal/Core/Lock/Tests/FunctionalTest.phpundefined
+++ b/core/lib/Drupal/Core/Lock/Tests/FunctionalTest.phpundefined
@@ -4,9 +4,11 @@

@@ -4,9 +4,11 @@
  * Tests for the lock system.

Docblock needs to be updated to "Definition of className."

+++ b/core/lib/Drupal/Core/Lock/Tests/FunctionalTest.phpundefined
@@ -4,9 +4,11 @@
 
-class LockFunctionalTest extends WebTestBase {
+class FunctionalTest extends WebTestBase {

Not convinced that this makes sense and we haven't done this for all other tests. "FunctionalTest" is imho too generic.

+++ b/core/modules/simpletest/simpletest.moduleundefined
@@ -322,16 +322,29 @@ function simpletest_test_get_all() {
-    if ($cache = cache()->get('simpletest')) {
+    if (0 && $cache = cache()->get('simpletest')) {
       $groups = $cache->data;

Test code in here.

+++ b/core/modules/simpletest/simpletest.moduleundefined
@@ -322,16 +322,29 @@ function simpletest_test_get_all() {
       $classes = db_query("SELECT name FROM {registry} WHERE type = :type AND filename LIKE :name", array(':type' => 'class', ':name' => '%.test'))->fetchCol();
+      // @todo Registry does not remove stale test classes AT ALL anymore?!?
+      $classes = array();

?

No idea what you mean with this, this also doesn't belong here.

+++ b/core/modules/simpletest/simpletest.moduleundefined
@@ -322,16 +322,29 @@ function simpletest_test_get_all() {
+      foreach (glob(DRUPAL_ROOT . '/core/lib/Drupal/Component/*') as $core) {
+        $name = 'Component/' . basename($core);
+        $filename = 'core/core';
+        $system_list[$name] = $filename;

core/core?

disasm’s picture

attached is a reroll as well as tackling some of the low hanging fruit in the comments in 6. I left the 0 && hack because I don't know what's trying to be accomplished there. It pretty much just guarantees the else branch is always ran. If this is the intended behavior, probably the if statement should be removed completely.

Leaving needs work because this is NOT ready for review.

Berdir’s picture

Status: Needs work » Closed (duplicate)

We have phpunit now for that, close this as a duplicate?