diff --git a/core/tests/Drupal/Tests/Component/Utility/CryptRandomFallbackTest.php b/core/tests/Drupal/Tests/Component/Utility/CryptRandomFallbackTest.php index b203761..919a810 100644 --- a/core/tests/Drupal/Tests/Component/Utility/CryptRandomFallbackTest.php +++ b/core/tests/Drupal/Tests/Component/Utility/CryptRandomFallbackTest.php @@ -3,7 +3,7 @@ namespace Drupal\Component\Utility; /** - * Define a function in same namespace as Drupal\Component\Utility\Crypt. + * Defines a function in same namespace as Drupal\Component\Utility\Crypt. * * Forces throwing an exception in this test environment because the function * in the namespace is used in preference to the global function. @@ -24,7 +24,7 @@ function random_bytes($count) { use Drupal\Component\Utility\Crypt; /** - * Tests fallback random byte generation when random_bytes() throws an Exception. + * Tests random byte generation fallback exception situations. * * @group Utility * @@ -44,9 +44,16 @@ public static function functionCalled() { /** * Tests random byte generation using the fallback generator. * + * If the call to random_bytes() throws an exception, Crypt::random_bytes() + * should still return a useful string of random bytes. + * * @covers ::randomBytes + * + * @see \Drupal\Tests\Component\Utility\CryptTest::testRandomBytes() */ public function testRandomBytesFallback() { + // This loop is a copy of + // \Drupal\Tests\Component\Utility\CryptTest::testRandomBytes(). for ($i = 0; $i < 10; $i++) { $count = rand(10, 10000); // Check that different values are being generated. diff --git a/core/tests/Drupal/Tests/Component/Utility/CryptTest.php b/core/tests/Drupal/Tests/Component/Utility/CryptTest.php index ff1e6cc..42d6015 100644 --- a/core/tests/Drupal/Tests/Component/Utility/CryptTest.php +++ b/core/tests/Drupal/Tests/Component/Utility/CryptTest.php @@ -18,6 +18,8 @@ class CryptTest extends UnitTestCase { * Tests random byte generation. * * @covers ::randomBytes + * + * @see \Drupal\Tests\Component\Utility\CryptRandomFallbackTest::testRandomBytesFallback */ public function testRandomBytes() { for ($i = 1; $i < 10; $i++) {