Security update for Core, with self-updated composer
[yaffs-website] / web / core / tests / Drupal / Tests / Component / PhpStorage / FileStorageReadOnlyTest.php
index 8b8c95acd9e35b0ec5d54983ccf5663405062e95..46ef59001ac099a3a337cd0af7c3236b70b1f113 100644 (file)
@@ -4,6 +4,7 @@ namespace Drupal\Tests\Component\PhpStorage;
 
 use Drupal\Component\PhpStorage\FileStorage;
 use Drupal\Component\PhpStorage\FileReadOnlyStorage;
+use Drupal\Component\Utility\Random;
 
 /**
  * @coversDefaultClass \Drupal\Component\PhpStorage\FileReadOnlyStorage
@@ -48,8 +49,11 @@ class FileStorageReadOnlyTest extends PhpStorageTestBase {
    * Tests writing with one class and reading with another.
    */
   public function testReadOnly() {
+    // Random generator.
+    $random = new Random();
+
     $php = new FileStorage($this->standardSettings);
-    $name = $this->randomMachineName() . '/' . $this->randomMachineName() . '.php';
+    $name = $random->name(8, TRUE) . '/' . $random->name(8, TRUE) . '.php';
 
     // Find a global that doesn't exist.
     do {
@@ -85,8 +89,11 @@ class FileStorageReadOnlyTest extends PhpStorageTestBase {
    * @covers ::deleteAll
    */
   public function testDeleteAll() {
+    // Random generator.
+    $random = new Random();
+
     $php = new FileStorage($this->standardSettings);
-    $name = $this->randomMachineName() . '/' . $this->randomMachineName() . '.php';
+    $name = $random->name(8, TRUE) . '/' . $random->name(8, TRUE) . '.php';
 
     // Find a global that doesn't exist.
     do {