diff --git a/core/modules/simpletest/src/TestDiscovery.php b/core/modules/simpletest/src/TestDiscovery.php index 2ae84b2..3bc9ffa 100644 --- a/core/modules/simpletest/src/TestDiscovery.php +++ b/core/modules/simpletest/src/TestDiscovery.php @@ -97,7 +97,7 @@ public function registerTestNamespaces() { // Add Simpletest test namespace. $this->testNamespaces["Drupal\\$name\\Tests\\"][] = "$base_path/src/Tests"; - // Add PHPUnit test namespaces. + // Add PHPUnit test namespace. $this->testNamespaces["Drupal\\Tests\\$name\\"][] = "$base_path/tests/src"; } diff --git a/core/modules/simpletest/tests/src/Traits/TestTrait.php b/core/modules/simpletest/tests/src/Traits/TestTrait.php index ddabba7..1bd1738 100644 --- a/core/modules/simpletest/tests/src/Traits/TestTrait.php +++ b/core/modules/simpletest/tests/src/Traits/TestTrait.php @@ -3,18 +3,22 @@ /** * @file * Contains \Drupal\Tests\simpletest\TestTrait. - * - * A nothing trait, but declared in the Drupal\Tests namespace. - * - * @see Drupal\Tests\simpletest\Unit\TestTraitAccessTest */ namespace Drupal\Tests\simpletest\Traits; - +/** + * Provides a trait declared in the Drupal\Tests namespace. + * + * We declare the trait here to make sure that traits found in + * the Drupal\Tests namespace are visible to our test runner. + * + * @see Drupal\Tests\simpletest\Unit\TestTraitAccessTest + */ trait TestTrait { /** - * Random string for a not very interesting trait. + * Test string for our not very interesting trait. + * * @var string */ protected $stuff = 'stuff'; @@ -23,9 +27,10 @@ * Return a test string to a trait user. * * @return string - * Just a random sort of string. + * A test string. */ protected function getStuff() { return $this->stuff; } + } diff --git a/core/modules/simpletest/tests/src/Unit/TraitAccessTest.php b/core/modules/simpletest/tests/src/Unit/TraitAccessTest.php index d699656..46fe07d 100644 --- a/core/modules/simpletest/tests/src/Unit/TraitAccessTest.php +++ b/core/modules/simpletest/tests/src/Unit/TraitAccessTest.php @@ -12,7 +12,7 @@ use Drupal\Tests\simpletest\Traits\TestTrait; /** - * Tests if a PHPUnit test can find a trait in its own namespace. + * Tests if a PHPUnit test can find a trait under the Drupal\Tests namespace. * * @group simpletest */ @@ -20,6 +20,9 @@ class TraitAccessTest extends UnitTestCase { use TestTrait; + /** + * Test if method acquired via the trait is found. + */ public function testSimpleStuff() { $stuff = $this->getStuff(); $this->assertSame($stuff, 'stuff', "Same old stuff");